From: Lars Ingebrigtsen Date: Wed, 5 Aug 2020 09:34:56 +0000 (+0200) Subject: Fontize $(...) slightly better in bash mode X-Git-Tag: emacs-28.0.90~6811 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c9d550a301d3a5e62b3296804ccf42efc69d0796;p=emacs.git Fontize $(...) slightly better in bash mode * lisp/progmodes/sh-script.el (sh-font-lock-keywords-var): Fontize $(...) slightly better (bug#42417). Instead of just fontizing the first word in the expression, fontize until the closing parenthesis. This doesn't work well if you have nested $(...) expressions. --- diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 044d7820ee3..5a47594878e 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -838,7 +838,7 @@ See `sh-feature'.") font-lock-variable-name-face)) (rc sh-append es) - (bash sh-append sh ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) )) + (bash sh-append sh ("\\$(\\([^)\n]+\\)" (1 'sh-quoted-exec t) )) (sh sh-append shell ;; Variable names. ("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2