]> git.eshelyaron.com Git - emacs.git/commitdiff
Fontize $(...) slightly better in bash mode
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 5 Aug 2020 09:34:56 +0000 (11:34 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 5 Aug 2020 09:34:56 +0000 (11:34 +0200)
* 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

index 044d7820ee3c725331a335bb7bea5c6a365ca1b5..5a47594878e288f0a2cf07c20c1031f544397cb4 100644 (file)
@@ -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