From 2532b960234e22ccec52e15cd25bcb561a1dc196 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 26 Aug 2011 12:29:11 +0200 Subject: [PATCH] EMACS: add outline function for PHP `.emacs.d/init.el' - Created function `oni-php-show-outline' which calls `occur' to search for PHP outlines (function, class, etc. definitions). - Bind to the function `oni-php-show-outline' in `php-mode'. --- .emacs.d/init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index a58aa80..528e650 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -120,6 +120,10 @@ (djcb-gtags-create-or-update))) ;;; PHP +(defun oni-php-show-outline () + (interactive) + (occur "\\(function .*(\\|\\(public\\|private\\|protected\\)\\( static\\)? \\$\\|class \\sw\\)")) + (autoload 'php-mode "php-mode" "Major mode for PHP" t) (setq-default php-mode-warn-if-mumamo-off nil) ; don't warn me about this (setq php-mode-force-pear t) @@ -128,7 +132,8 @@ (lambda () (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-close '0) - (local-set-key [f6] 'comment-line))) + (local-set-key [f6] 'comment-line) + (local-set-key [f7] 'oni-php-show-outline))) (add-php-keywords) ;;; bidi