Subject: Re: bug#52496: syntax highlighting problem on emacs shell-script mode

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 19 Dec 2021 15:10:22 +0100

Andreas Schwab <[email-masked]> writes:

> On Dez 19 2021, Lars Ingebrigtsen wrote:
>
>> Right.  I haven't real the shell documentation -- is "@" a valid heredoc
>> ... separator?
>
> Any word is.

But is @ word constituent?

It's not in sh-mode's word definition, anyway.  The following tweak
fixes this particular problem, but I have no idea whether it was what
what originally reported.

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index c6b6f83471..01bebe4a23 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -867,7 +867,7 @@ sh-here-doc-syntax
     "\\(?:\\(?:.*[^\\\n]\\)?\\(?:\\\\\\\\\\)*\\\\\n\\)*.*")
 
   (defconst sh-here-doc-open-re
-    (concat "[^<]<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\|[-/~._]\\)+\\)"
+    (concat "[^<]<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\|[-/~._@]\\)+\\)"
             sh-escaped-line-re "\\(\n\\)")))
 
 (defun sh--inside-noncommand-expression (pos)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no