1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Allow more shell script defun forms

* lisp/progmodes/sh-script.el (sh-mode): Allow more shell
script defun forms, like function name () {...} (bug#19754).
This commit is contained in:
Carlos Pita 2016-02-23 22:15:00 +11:00 committed by Lars Ingebrigtsen
parent 8e7712c7af
commit c817549b52

View file

@ -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)