aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Pita2016-02-23 22:15:00 +1100
committerLars Ingebrigtsen2016-02-23 22:16:26 +1100
commitc817549b520ce3b10a949f00fcabf8a3a62697ae (patch)
treedb0a5202ce15a0f0a763cdfdbfdf437da32d92fb
parent8e7712c7afc47a8a861a9f4d6a10be1f78a2dac6 (diff)
downloademacs-c817549b520ce3b10a949f00fcabf8a3a62697ae.tar.gz
emacs-c817549b520ce3b10a949f00fcabf8a3a62697ae.zip
Allow more shell script defun forms
* lisp/progmodes/sh-script.el (sh-mode): Allow more shell script defun forms, like function name () {...} (bug#19754).
-rw-r--r--lisp/progmodes/sh-script.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 7f89ab2762c..5f29bb64f05 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1661,7 +1661,12 @@ with your script for an edit-interpret-debug cycle."
1661 (setq-local skeleton-filter-function 'sh-feature) 1661 (setq-local skeleton-filter-function 'sh-feature)
1662 (setq-local skeleton-newline-indent-rigidly t) 1662 (setq-local skeleton-newline-indent-rigidly t)
1663 (setq-local defun-prompt-regexp 1663 (setq-local defun-prompt-regexp
1664 (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) 1664 (concat
1665 "^\\("
1666 "\\(function[ \t]\\)?[ \t]*[[:alnum:]]+[ \t]*([ \t]*)"
1667 "\\|"
1668 "function[ \t]+[[:alnum:]]+[ \t]*\\(([ \t]*)\\)?"
1669 "\\)[ \t]*"))
1665 (setq-local add-log-current-defun-function #'sh-current-defun-name) 1670 (setq-local add-log-current-defun-function #'sh-current-defun-name)
1666 (add-hook 'completion-at-point-functions 1671 (add-hook 'completion-at-point-functions
1667 #'sh-completion-at-point-function nil t) 1672 #'sh-completion-at-point-function nil t)