diff options
author | Juanma Barranquero <[email protected]> | 2003-02-11 23:47:11 +0000 |
---|---|---|
committer | Juanma Barranquero <[email protected]> | 2003-02-11 23:47:11 +0000 |
commit | 61bc75ab6ca503e5be3b2736a5ce8e13f40f1722 (patch) | |
tree | 0aab58d8c740410e5ec1ed86aab0a1036c224d6e /lisp/progmodes/make-mode.el | |
parent | c47a201af79d6295c6bd21d0c563f1eeecef1a50 (diff) |
(makefile-font-lock-keywords): Fontify single character variable references, but
protect shell variables references.
(makefile-mode): Make `$' be punctuation in font-lock-defaults.
Diffstat (limited to 'lisp/progmodes/make-mode.el')
-rw-r--r-- | lisp/progmodes/make-mode.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 4d825f8323..98a3d46088 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -268,13 +268,16 @@ not be enclosed in { } or ( )." ;; Do dependencies. These get the function name face. (list makefile-dependency-regex 1 'font-lock-function-name-face) - ;; Variable references even in targets/strings/comments: + ;; Variable references even in targets/strings/comments. '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend) - ;; Automatic variable references. - '("\\$\\([@%<?^+*]\\)" 1 font-lock-reference-face prepend) + ;; Automatic variable references and single character variable references... + '("\\$\\([@%<?^+*_]\\|[a-zA-Z0-9]\\>\\)" 1 font-lock-reference-face prepend) '("\\$[({]\\([@%<?^+*][FD]?\\)[}):]" 1 font-lock-reference-face prepend) + ;; ...but not shell variables references. + '("\\$\\$\\(\\sw+\\)" 1 'default t) + ;; Fontify conditionals and includes. ;; Note that plain `if' is an automake conditional, and not a bug. (list @@ -586,7 +589,7 @@ Makefile mode can be configured by modifying the following variables: ;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down ;; near the end of a large buffer, due to parse-partial-sexp's ;; trying to parse all the way till the beginning of buffer. - '(makefile-font-lock-keywords nil nil nil backward-paragraph)) + '(makefile-font-lock-keywords nil nil ((?$ . ".")) backward-paragraph)) ;; Add-log. (make-local-variable 'add-log-current-defun-function) |