[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d630a04: Further tweaks to sh-script \ #foo font locking
From: |
Lars Ingebrigtsen |
Subject: |
master d630a04: Further tweaks to sh-script \ #foo font locking |
Date: |
Thu, 31 Oct 2019 08:07:54 -0400 (EDT) |
branch: master
commit d630a047bbba8bf0ab07250a7f750eefb3a48eae
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Further tweaks to sh-script \ #foo font locking
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
Tweak previous \ #foo change to work on all quoted characters, but
check that the backslash itself is not backslashed. Regexp from
Stefan Monnier.
---
lisp/progmodes/sh-script.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b2f896e..6ec1319 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1140,8 +1140,10 @@ subshells can nest."
;; beginning of a word. In the shell, words are separated by
;; metacharacters. The list of special chars is taken from
;; the single-unix spec of the shell command language (under
- ;; `quoting') but with `$' removed.
- ("\\(?:[^|&;<>(`\\\"' \t\n]\\|\\${\\|\\\\ \\)\\(#+\\)" (1 "_"))
+ ;; `quoting') but with `$' removed. Also -- if there's something like
+ ;; \ #foo, then that's not a comment, unless the backslash itself
+ ;; is backslashed.
+ ("\\(?:[^|&;<>(`\\\"'
\t\n]\\|\\${\\|\\(?:[^\\]\\|^\\)\\\\\\(?:\\\\\\\\\\)*.\\)\\(#+\\)" (1 "_"))
;; In addition, `#' at the beginning of closed parentheses
;; does not start a comment if the parentheses are not isolated
;; by metacharacters, excluding [()].
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master d630a04: Further tweaks to sh-script \ #foo font locking,
Lars Ingebrigtsen <=