3.12.6.4 Changing Colors

The Prolog mode uses the default Emacs colors for font-locking as far as possible. The only custom settings are in the Prolog process buffer. The default settings of the colors may not agree with your preferences, so here is how to change them.

If your Emacs supports it, use ‘Customize’. M-x customize-group <RET> font-lock <RET> will show the ‘Customize’ settings for font locking and also contains pointers to the ‘Customize’ group for the font lock (type)faces. The rest of this section outlines the more involved methods needed in older versions of Emacs.

First of all, list all available faces (a face is a combined setting of foreground and background colors, font, boldness, etc.) by typing M-x list-faces-display.

There are several functions that change the appearance of a face, the ones you will most likely need are:

These can be tested interactively by typing M-x function-name. You will then be asked for the name of the face to change and a value. If the buffers are not updated according to the new settings, refontify the buffer using the Fontify Buffer menu entry in the Prolog menu.

Colors are specified by a name or by RGB values. Available color names can be listed with M-x list-colors-display.

To store the settings of the faces, a few lines must be added to ~/.emacs. For example:

     ;; Customize font-lock faces
     (add-hook 'font-lock-mode-hook
               '(lambda ()
                  (set-face-foreground font-lock-variable-name-face "#00a000")
                  (make-face-bold font-lock-keyword-face)
                  (set-face-foreground font-lock-reference-face "Blue")
                  ))

Send feedback on this subject.