]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve syntax highlighting in bat-mode
authorEli Zaretskii <eliz@gnu.org>
Fri, 22 Sep 2017 13:40:59 +0000 (16:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 22 Sep 2017 13:40:59 +0000 (16:40 +0300)
* lisp/progmodes/bat-mode.el (bat-font-lock-keywords): Improve
font-locking of environment variables.  Suggested by Achim Gratz
<Stromeko@nexgo.de>.  (Bug#28311)  (Bug#18405)

lisp/progmodes/bat-mode.el

index f4852fe5b6b93017a527c1b042650d0b3d99dcaf..e06b8e830b91ac64382d76c1e21c651a1c133045 100644 (file)
          . 'bat-label-face)
         ("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)"
          (2 font-lock-variable-name-face))
-        ("%\\(\\(\\sw\\|\\s_\\)+\\)%"
+        ("%\\([^% \n]+\\)%?"
          (1 font-lock-variable-name-face))
-        ("!\\(\\(\\sw\\|\\s_\\)+\\)!"  ; delayed-expansion !variable!
+        ("!\\([^!% \n]+\\)!?"  ; delayed-expansion !variable!
          (1 font-lock-variable-name-face))
-        ("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)"
+        ("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\|_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)"
          (1 font-lock-variable-name-face nil t) ; PATH expansion
          (2 font-lock-variable-name-face)) ; iteration variable or positional parameter
         ("[ =][-/]+\\(\\w+\\)"