diff options
| author | Jonathan Shin Hayase | 2019-06-25 23:00:20 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-25 23:00:20 +0200 |
| commit | 955e3703736d3de5a3d0784f3b70a95132a4f7bd (patch) | |
| tree | 2f17a3a35fa2c2494e9e02ba99260393bd310246 | |
| parent | 59550f7cce9b51f817b89a78f6c4ab3723e70beb (diff) | |
| download | emacs-955e3703736d3de5a3d0784f3b70a95132a4f7bd.tar.gz emacs-955e3703736d3de5a3d0784f3b70a95132a4f7bd.zip | |
Highlight zsh glob flags and qualifiers in sh-mode
* lisp/progmode/sh-script.el (sh-syntax-propertize-function):
Add regexps to highlight zsh glob flags and alternate qualifiers
without mistaking them for comments. (bug#19455).
| -rw-r--r-- | lisp/progmodes/sh-script.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 853a3500ee1..aa6ada96cd4 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1141,7 +1141,13 @@ subshells can nest." | |||
| 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. |
| 1144 | ("\\(?:[^|&;<>()`\\\"' \t\n]\\|\\${\\)\\(#+\\)" (1 "_")) | 1144 | ("\\(?:[^|&;<>(`\\\"' \t\n]\\|\\${\\)\\(#+\\)" (1 "_")) |
| 1145 | ;; In addition, `#' at the beginning of closed parentheses | ||
| 1146 | ;; does not start a comment if the parentheses are not isolated | ||
| 1147 | ;; by metacharacters, excluding [()]. | ||
| 1148 | ;; (e.g. `foo(#q/)' and `(#b)foo' in zsh) | ||
| 1149 | ("[^|&;<>(`\\\"' \t\n](\\(#+\\)" (1 "_")) | ||
| 1150 | ("(\\(#\\)[^)]+?)[^|&;<>)`\\\"' \t\n]" (1 "_")) | ||
| 1145 | ;; In a '...' the backslash is not escaping. | 1151 | ;; In a '...' the backslash is not escaping. |
| 1146 | ("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote))) | 1152 | ("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote))) |
| 1147 | ;; Make sure $@ and $? are correctly recognized as sexps. | 1153 | ;; Make sure $@ and $? are correctly recognized as sexps. |