Next: , Previous: , Up: Top   [Contents]


3 Declaring Faces

Faces are declared with defface.

Function: defface face spec doc [keyword value]...

Declare face as a customizable face that defaults to spec. face does not need to be quoted.

If face has been set with ‘custom-set-face’, set the face attributes as specified by that function, otherwise set the face attributes according to spec.

doc is the face documentation.

spec should be an alist of the form ‘((display atts)...)’.

atts is a list of face attributes and their values. The possible attributes are defined in the variable ‘custom-face-attributes’.

The atts of the first entry in spec where the display matches the frame should take effect in that frame. display can either be the symbol ‘t’, which will match all frames, or an alist of the form ‘((req item...)...)

For the display to match a FRAME, the req property of the frame must match one of the item. The following req are defined:

type

(the value of (window-system))
Should be one of x or tty.

class

(the frame’s color support)
Should be one of color, grayscale, or mono.

background

(what color is used for the background text)
Should be one of light or dark.

Internally, custom uses the symbol property face-defface-spec for the program specified default face properties, saved-face for properties saved by the user, and face-documentation for the documentation string.