aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2001-04-25 15:52:45 +0000
committerStefan Monnier <[email protected]>2001-04-25 15:52:45 +0000
commit1dc64fca5b9e64b79d8839ccc36cdd1c7fb48371 (patch)
tree0f71e764d818bd31b66e9ba4834c7c9884d98f6b /lisp/progmodes
parent7cd512f22f12d22e29a35aafceab613e5aefadee (diff)
(makefile-font-lock-keywords):
Rationalize the rules for includes and conditionals and use the keyword face for them.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/make-mode.el21
1 files changed, 6 insertions, 15 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 72e2e863a7..8e5948661c 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -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.