From 39e7e36ac559499d2a9ee91fe6b3099d1759911b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Jul 1998 21:37:22 +0000 Subject: [PATCH] (makefile-font-lock-keywords): Recognize automatic variable references. (makefile-dependency-regex): Don't be fooled by colons in deps. --- lisp/progmodes/make-mode.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 54fd5983025..e5d7028e409 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -234,7 +234,7 @@ not be enclosed in { } or ( )." ;; that if you change this regexp you must fix the imenu index ;; function defined at the end of the file. (defconst makefile-dependency-regex - "^ *\\([^ \n\t#:=]+\\([ \t]+[^ \t\n#:=]+\\)*\\)[ \t]*:\\([ \t]*$\\|\\([^=\n].*$\\)\\)" + "^ *\\([^ \n\t#:=]+\\([ \t]+\\([^ \t\n#:=]+\\|\\$[({][^ \t\n#})]+[})]\\)\\)*\\)[ \t]*:\\([ \t]*$\\|\\([^=\n].*$\\)\\)" "Regex used to find dependency lines in a makefile.") ;; Note that the first subexpression is used by font lock. Note that @@ -264,7 +264,10 @@ not be enclosed in { } or ( )." ;; ;; Variable references even in targets/strings/comments: '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend) - + ;; + ;; Automatic variable references. + '("\\$\\([@%