From c9d550a301d3a5e62b3296804ccf42efc69d0796 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 5 Aug 2020 11:34:56 +0200 Subject: [PATCH] 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. --- lisp/progmodes/sh-script.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2