elliott
elliott

Reputation: 11

How to customize colors in f90-mode emacs?

When I use emacs in f90mode, some instructions appear in a different color (like size, if, print, end, do, etc.). I would like to set up that very same color for a number of functions I defined. How could I accomplish this? Is there any file I could customize?

Thanks in advance.

Upvotes: 1

Views: 238

Answers (1)

roygvib
roygvib

Reputation: 7395

FWIW, my .emacs file contain these lines, which seems to change colors for Fortran sources (I guess I consulted some page like this one, but do not remember details, sorry...)

(set-face-foreground 'font-lock-comment-face "green")
(set-face-foreground 'font-lock-keyword-face "lightblue")
(set-face-foreground 'font-lock-type-face "green")
(set-face-foreground 'font-lock-function-name-face "pink")
(set-face-foreground 'font-lock-variable-name-face "black")
;; the above colors are just random examples...

Also, we can change the color of %(the selector symbol of type components) by

(font-lock-add-keywords 'f90-mode
        '(("%" . font-lock-keyword-face)))

where font-lock-keyword-fact is the color specified above. By using the above commands, it may be possible to customize the color as you like (to some extent).

Upvotes: 1

Related Questions