]> git.eshelyaron.com Git - emacs.git/commitdiff
Add some f90 preprocessor font-lock (bug#10499)
authorGlenn Morris <rgm@gnu.org>
Thu, 21 Jun 2012 19:31:49 +0000 (15:31 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 21 Jun 2012 19:31:49 +0000 (15:31 -0400)
* lisp/progmodes/f90.el (f90-font-lock-keywords-2):
Add some preprocessor elements.

lisp/ChangeLog
lisp/progmodes/f90.el

index c26a196ebe7a10605f9f4e43b819d66df6ab5d4f..a9fb4963233e5537566e6dce9de645f072396f04 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-21  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/f90.el (f90-font-lock-keywords-2):
+       Add some preprocessor elements.  (Bug#10499)
+
 2012-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/cperl-mode.el (cperl-update-syntaxification):
index df6fdfd7cd96854efa9423fc8e20bdb5f76120c0..0c8071cdc4dfb47e22c1f8a56e93282d3f087ecf 100644 (file)
   :safe  'stringp
   :group 'f90-indent)
 
+;; Should we add ^# to this?  That's not really a comment.
 (defcustom f90-directive-comment-re "!hpf\\$"
   "Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented."
   :type  'regexp
@@ -627,7 +628,14 @@ logical\\|double[ \t]*precision\\|type[ \t]*(\\sw+)\\|none\\)[ \t]*"
     '("\\<\\(do\\|go[ \t]*to\\)\\>[ \t]*\\([0-9]+\\)"
       (1 font-lock-keyword-face) (2 font-lock-constant-face))
     ;; Line numbers (lines whose first character after number is letter).
-    '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t))))
+    '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t))
+    ;; Override eg for "#include".
+    '("^#[ \t]*\\w+" (0 font-lock-preprocessor-face t)
+      ("\\<defined\\>" nil nil (0 font-lock-preprocessor-face)))
+    '("^#" ("\\(&&\\|||\\)" nil nil (0 font-lock-constant-face t)))
+    '("^#[ \t]*define[ \t]+\\(\\w+\\)(" (1 font-lock-function-name-face))
+    '("^#[ \t]*define[ \t]+\\(\\w+\\)" (1 font-lock-variable-name-face))
+    '("^#[ \t]*include[ \t]+\\(<.+>\\)" (1 font-lock-string-face))))
   "Highlights declarations, do-loops and other constructs.")
 
 (defvar f90-font-lock-keywords-3