[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-scr
From: |
Ola Nilsson |
Subject: |
bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-script-mode |
Date: |
Fri, 21 Jun 2019 01:01:22 +0200 |
POSIX.1-2017 defines that functions should have a name that
'consisting solely of underscores, digits, and alphabetics from the
portable character set'. Make sure the name part of
defun-prompt-regexp starts with a letter and allows underscores.
* lisp/progmodes/sh-script.el (defun-prompt-regexp):
Correct the function name part of the regexp.
---
lisp/progmodes/sh-script.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 853a3500ee..24f242572f 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1619,9 +1619,9 @@ sh-mode
(setq-local defun-prompt-regexp
(concat
"^\\("
- "\\(function[ \t]\\)?[ \t]*[[:alnum:]]+[ \t]*([ \t]*)"
+ "\\(function[ \t]\\)?[ \t]*[[:alpha:]][[:alnum:]_]+[ \t]*([
\t]*)"
"\\|"
- "function[ \t]+[[:alnum:]]+[ \t]*\\(([ \t]*)\\)?"
+ "function[ \t]+[[:alpha:]][[:alnum:]_]+[ \t]*\\(([ \t]*)\\)?"
"\\)[ \t]*"))
(setq-local add-log-current-defun-function #'sh-current-defun-name)
(add-hook 'completion-at-point-functions
--
2.11.0
- bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-script-mode,
Ola Nilsson <=