unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-script-mode
@ 2019-06-20 23:01 Ola Nilsson
  2019-06-22  4:13 ` Richard Stallman
  2019-06-23 21:00 ` bug#36317: [PATCH v2] Allow underscore in defun-prompt-regex names for sh-script Ola Nilsson
  0 siblings, 2 replies; 7+ messages in thread
From: Ola Nilsson @ 2019-06-20 23:01 UTC (permalink / raw)
  To: 36317; +Cc: Ola Nilsson

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






^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-28  0:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20 23:01 bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-script-mode Ola Nilsson
2019-06-22  4:13 ` Richard Stallman
2019-06-24 20:23   ` Ola Nilsson
2019-06-23 21:00 ` bug#36317: [PATCH v2] Allow underscore in defun-prompt-regex names for sh-script Ola Nilsson
2019-06-25 14:01   ` Noam Postavsky
2019-06-26 20:58     ` Ola Nilsson
2019-06-28  0:15       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).