From: Carlos Pita Date: Tue, 23 Feb 2016 11:15:00 +0000 (+1100) Subject: Allow more shell script defun forms X-Git-Tag: emacs-26.0.90~2484 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c817549b520ce3b10a949f00fcabf8a3a62697ae;p=emacs.git Allow more shell script defun forms * lisp/progmodes/sh-script.el (sh-mode): Allow more shell script defun forms, like function name () {...} (bug#19754). --- 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." (setq-local skeleton-filter-function 'sh-feature) (setq-local skeleton-newline-indent-rigidly t) (setq-local defun-prompt-regexp - (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) + (concat + "^\\(" + "\\(function[ \t]\\)?[ \t]*[[:alnum:]]+[ \t]*([ \t]*)" + "\\|" + "function[ \t]+[[:alnum:]]+[ \t]*\\(([ \t]*)\\)?" + "\\)[ \t]*")) (setq-local add-log-current-defun-function #'sh-current-defun-name) (add-hook 'completion-at-point-functions #'sh-completion-at-point-function nil t)