]> gitweb.michael.orlitzky.com - nagios-mode.git/blobdiff - nagios-mode.el
Added another string test (passing).
[nagios-mode.git] / nagios-mode.el
index f8ea84270a3bb56893e728610e5d44deabaf784b..7a699b73ca23e6b5534fa5a9407add53d41ba61e 100644 (file)
 
 
 
+(defconst nagios-string
+  (eval-when-compile
+    "\\(\".*?\"\\)"))
+
+
 ;; The One True Font Locking Variable
 
 (defvar nagios-font-lock-keywords
   (list
 
+   ;; Font lock the comments first.
+   (cons nagios-comments font-lock-comment-delimiter-face)
+
+   ;; Strings have the highest priority. For now, this is broken,
+   ;; but I guess I would rather have strings miscolored within
+   ;; comments than the other way around.
+   (cons nagios-string '(0 font-lock-string-face t))
+
    (cons nagios-special font-lock-keyword-face)
    (cons nagios-directives font-lock-variable-name-face)
    (cons nagios-macros font-lock-constant-face)
-   (cons nagios-definitions font-lock-function-name-face)
-
-   ;; We have to (override) un-color the curly braces here because it's
-   ;; possible for them to become colored along with a definition
-   ;; if there is no space between the definition and the open
-   ;; brace. This has to come after the nagios-definitions, otherwise
-   ;; the font-locking will miss the definitions that end with a brace.
-   (cons "[{}]" '(0 nil t))
-
-  ;; And comments take precedence over everything else.
-   (cons nagios-comments '(0 font-lock-comment-delimiter-face t)))
+   (cons nagios-definitions '(1 font-lock-function-name-face)))
 
   "Rules for highlighting Nagios configuration files."
   )