bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: f90.el doesn't recognize elemental attribute for hiliting


From: Glenn Morris
Subject: Re: f90.el doesn't recognize elemental attribute for hiliting
Date: Sat, 30 Mar 2002 20:47:54 +0000
User-agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2 (i686-pc-linux-gnu)

Richard E Hawkins <address@hidden> wrote:

> recursive function mutation(thegene)
>
> will highlight both "recursive" and "function" properly.
>
> elemental function mutation(thegene)
>
> fails to highlight "elemental"

The "elemental" specification is an F95 feature, so one could make a
reasonable case that there is no reason why F90 mode should support this.
"recursive", on the other hand, is an F90 specification.

I use the following in my .emacs to get F95 syntax highlighted:


(defface f95-keyword-face
  '((t (:foreground "plum1")))
  "F95 keywords face.")

(defface f95-function-face
  '((t (:foreground "azure1")))
  "F95 function name face.")


(defvar f95-font-lock-keywords
  (list
   '("\\<\\(pure\\|elemental\\)\\>" . 'f95-keyword-face)

   ;; Override existing highlighting of 'elsewhere', etc, but not in comments.
   '("\\<\\(null\\|cpu_time\\|elsewhere\\)\\>[ \t]*("
         (1 (if (f90-in-comment) 'font-lock-comment-face 'f95-function-face) t))

   ;; Plain forall should not really be highlighted without trailing '(',
   ;; but is in existing f90-mode.
   '("\\(\\<end\\> *\\)?\\<forall\\>" .
         (0 (if (f90-in-comment) 'font-lock-comment-face 'f95-function-face) t))

   ;; Highlight the extra 'dim' keyword for these functions.
   '("\\<\\(\\(max\\|min\\)loc\\|ceiling\\|floor\\)\\>[ \t]*("
                         ("\\<dim\\>" nil nil (0 'f95-keyword-face)))
   )
  "Highlights extra F95 keywords.")


(font-lock-add-keywords 'f90-mode f95-font-lock-keywords)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]