aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-31 13:07:37 +0100
committerLars Ingebrigtsen2019-10-31 13:07:37 +0100
commitd630a047bbba8bf0ab07250a7f750eefb3a48eae (patch)
treeafd9b4b867c69943cda3780f408fccee673b24a3
parentbdb33af39d32cfb0bb23f18eb34775a30e2ff62d (diff)
downloademacs-d630a047bbba8bf0ab07250a7f750eefb3a48eae.tar.gz
emacs-d630a047bbba8bf0ab07250a7f750eefb3a48eae.zip
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.
-rw-r--r--lisp/progmodes/sh-script.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b2f896ecab9..6ec131980be 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1140,8 +1140,10 @@ subshells can nest."
1140 ;; beginning of a word. In the shell, words are separated by 1140 ;; beginning of a word. In the shell, words are separated by
1141 ;; metacharacters. The list of special chars is taken from 1141 ;; metacharacters. The list of special chars is taken from
1142 ;; the single-unix spec of the shell command language (under 1142 ;; the single-unix spec of the shell command language (under
1143 ;; `quoting') but with `$' removed. 1143 ;; `quoting') but with `$' removed. Also -- if there's something like
1144 ("\\(?:[^|&;<>(`\\\"' \t\n]\\|\\${\\|\\\\ \\)\\(#+\\)" (1 "_")) 1144 ;; \ #foo, then that's not a comment, unless the backslash itself
1145 ;; is backslashed.
1146 ("\\(?:[^|&;<>(`\\\"' \t\n]\\|\\${\\|\\(?:[^\\]\\|^\\)\\\\\\(?:\\\\\\\\\\)*.\\)\\(#+\\)" (1 "_"))
1145 ;; In addition, `#' at the beginning of closed parentheses 1147 ;; In addition, `#' at the beginning of closed parentheses
1146 ;; does not start a comment if the parentheses are not isolated 1148 ;; does not start a comment if the parentheses are not isolated
1147 ;; by metacharacters, excluding [()]. 1149 ;; by metacharacters, excluding [()].