aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMasatake YAMATO2012-07-18 09:40:57 -0400
committerStefan Monnier2012-07-18 09:40:57 -0400
commit7f5331cc805b811678d03d7c9be6efe8966ecbfa (patch)
tree6b529e3c6996a28b29305cace2a5794aa03e747f /lisp/progmodes
parent9aeb25a6b4d684bd79a309326b047ac0ea4afca4 (diff)
downloademacs-7f5331cc805b811678d03d7c9be6efe8966ecbfa.tar.gz
emacs-7f5331cc805b811678d03d7c9be6efe8966ecbfa.zip
* lisp/progmodes/sh-script.el (sh-imenu-generic-expression):
Capture a function with `function' keyword and without parentheses like "function FOO". Fixes: debbugs:11856
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/sh-script.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index be664c6fc6e..a713539cd8e 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -327,8 +327,15 @@ shell it really is."
327(defcustom sh-imenu-generic-expression 327(defcustom sh-imenu-generic-expression
328 `((sh 328 `((sh
329 . ((nil 329 . ((nil
330 "^\\s-*\\(function\\s-+\\)?\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" 330 ;; function FOO
331 2)))) 331 ;; function FOO()
332 "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?"
333 1)
334 ;; FOO()
335 (nil
336 "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()"
337 1)
338 )))
332 "Alist of regular expressions for recognizing shell function definitions. 339 "Alist of regular expressions for recognizing shell function definitions.
333See `sh-feature' and `imenu-generic-expression'." 340See `sh-feature' and `imenu-generic-expression'."
334 :type '(alist :key-type (symbol :tag "Shell") 341 :type '(alist :key-type (symbol :tag "Shell")