fancier elisp, handle "include"
authorEvan Martin <martine@danga.com>
Sun, 23 Jan 2011 03:05:26 +0000 (19:05 -0800)
committerEvan Martin <martine@danga.com>
Sun, 23 Jan 2011 03:05:26 +0000 (19:05 -0800)
misc/ninja-mode.el

index b3982a4..0cb740c 100644 (file)
@@ -2,10 +2,13 @@
 ;; Just some syntax highlighting for now.
 
 (setq ninja-keywords
-      '(("^#.*" . font-lock-comment-face)
-        ("^\\<rule\\>\\|^\\<build\\>\\|^\\<subninja\\>" . font-lock-keyword-face)
-        ("\\([[:alnum:]_]+\\) =" . (1 font-lock-variable-name-face))
-        ))
+      (list
+       '("^#.*" . font-lock-comment-face)
+       (cons (concat "^" (regexp-opt '("rule" "build" "subninja" "include")
+                                     'words))
+             font-lock-keyword-face)
+       '("\\([[:alnum:]_]+\\) =" . (1 font-lock-variable-name-face))
+       ))
 (define-derived-mode ninja-mode fundamental-mode "ninja"
   (setq comment-start "#")
   ; Pass extra "t" to turn off syntax-based fontification -- we don't want