Subject: bug#31710: 26.1; sh-mode doesn't highlight aliases with dots correctly

From: Andreas Schwab <[email-masked]>
Date: Sat, 13 Jul 2019 17:34:35 +0200

On Jul 13 2019, Lars Ingebrigtsen <[email-masked]> wrote:

> Surely foo[....]="bar" isn't valid bash syntax?

Of course it is.

> I've installed the following patch on the Emacs trunk:
>
> diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
> index ae90531a7f..64608f1930 100644
> --- a/lisp/progmodes/sh-script.el
> +++ b/lisp/progmodes/sh-script.el
> @@ -582,7 +582,7 @@ sh-assignment-regexp
>      ;; actually spaces are only supported in let/(( ... ))
>      (ksh88 . ,(concat "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?"
>                        "[ \t]*\\(?:[-+*/%&|~^]\\|<<\\|>>\\)?="))
> -    (bash . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?\\+?=")
> +    (bash . "\\<\\([[:alnum:]_]+\\)\\([.+]\\)?\\+?=")

That doesn't make sense.  A dot or a plus isn't a valid character in a
shell variable.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."