[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31710: 26.1; sh-mode doesn't highlight aliases with dots correctly
From: |
Lars Ingebrigtsen |
Subject: |
bug#31710: 26.1; sh-mode doesn't highlight aliases with dots correctly |
Date: |
Sat, 13 Jul 2019 16:19:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Aria Edm <aria@ar1as.space> writes:
> run emacs -Q
> M-x sh-mode RET
> alias d="echo hi"
> alias d.="echo hi"
>
> the d is highlighted, d. isn't
Looks like there was a typo in the regexp. At least I think so? Surely
foo[....]="bar" isn't valid bash syntax?
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:]_]+\\)\\([.+]\\)?\\+?=")
(rc . "\\<\\([[:alnum:]_*]+\\)[ \t]*=")
(sh . "\\<\\([[:alnum:]_]+\\)="))
"Regexp for the variable name and what may follow in an assignment.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#31710: 26.1; sh-mode doesn't highlight aliases with dots correctly,
Lars Ingebrigtsen <=