]> git.eshelyaron.com Git - emacs.git/commitdiff
(makefile-font-lock-keywords):
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Apr 2001 15:52:45 +0000 (15:52 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Apr 2001 15:52:45 +0000 (15:52 +0000)
Rationalize the rules for includes and conditionals and use the
keyword face for them.

lisp/ChangeLog
lisp/progmodes/make-mode.el

index f22a1d6e597a720dca6a75a119c855b080f408bc..8731007e9904a5172c028c777604b412888aa94d 100644 (file)
@@ -1,5 +1,9 @@
 2001-04-25  Stefan Monnier  <monnier@cs.yale.edu>
 
+       * progmodes/make-mode.el (makefile-font-lock-keywords):
+       Rationalize the rules for includes and conditionals and use the
+       keyword face for them.
+
        * faces.el (modify-face): Add compatibility for non-interactive use.
 
 2001-04-24  John Wiegley  <johnw@gnu.org>
index 72e2e863a76262fbaa651e232f165d9a8f2b4aa0..8e5948661c0776b4084ddd3c97385be8e11472a0 100644 (file)
@@ -278,21 +278,12 @@ not be enclosed in { } or ( )."
 
    ;; Fontify conditionals and includes.
    ;; Note that plain `if' is an automake conditional, and not a bug.
-   '("^[ \t]*\\(-?include\\|if\\(n?eq\\|n?def\\)?\\)[ \t]+\\([^: \t\n#]+\\)"
-     (1 font-lock-warning-face) (3 font-lock-variable-name-face))
-
-   ;; Fontify endif and else.
-   '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?"
-     (1 font-lock-warning-face))
-
-   ;; Fontify conditionals and includes.
-   ;; Note that plain `if' is an automake conditional, and not a bug.
-   '("^[ \t]*\\(-?include\\|if\\(n?eq\\|n?def\\)?\\)[ \t]+\\([^: \t\n#]+\\)"
-     (1 font-lock-reference-face) (3 font-lock-variable-name-face))
-
-   ;; Fontify endif and else.
-   '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?"
-     (1 font-lock-reference-face))
+   (list
+    (concat "^\\(?: [ \t]*\\)?"
+           (regexp-opt '("-include" "-sinclude" "include" "sinclude" "ifeq"
+                         "if" "ifneq" "ifdef" "ifndef" "endif" "else") t)
+           "\\>[ \t]*\\([^: \t\n#]*\\)")
+    '(1 font-lock-keyword-face) '(2 font-lock-variable-name-face))
 
    ;; Highlight lines that contain just whitespace.
    ;; They can cause trouble, especially if they start with a tab.