changeset 49739:7e5f5bd11b07

(makefile-font-lock-keywords): Fontify single character variable references, but protect shell variables references. (makefile-mode): Make `$' be punctuation in font-lock-defaults.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 11 Feb 2003 23:45:21 +0000
parents fea5ab31df09
children b1415b1712d3
files lisp/progmodes/make-mode.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/make-mode.el	Tue Feb 11 23:26:55 2003 +0000
+++ b/lisp/progmodes/make-mode.el	Tue Feb 11 23:45:21 2003 +0000
@@ -268,13 +268,16 @@
    ;; 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 @@
 	;; 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)