Next: , Previous: , Up: Faces   [Contents][Index]


49.1.2 Basic Functions for Working with Faces

The properties a face can specify include the font, the foreground color, the background color, the background pixmap, the underlining, the display table, and (for TTY devices) whether the text is to be highlighted, dimmed, blinking, or displayed in reverse video. The face can also leave these unspecified, causing them to assume the value of the corresponding property of the default face.

Here are the basic primitives for working with faces.

Function: make-face name &optional doc-string temporary

This function defines and returns a new face named name, initially with all properties unspecified. It does nothing if there is already a face named name. Optional argument doc-string specifies an explanatory string used for descriptive purposes. If optional argument temporary is non-nil, the face will automatically disappear when there are no more references to it anywhere in text or Lisp code (otherwise, the face will continue to exist indefinitely even if it is not used).

Function: face-list &optional temporary

This function returns a list of the names of all defined faces. If temporary is nil, only the permanent faces are included. If it is t, only the temporary faces are included. If it is any other non-nil value both permanent and temporary are included.

Function: facep object

This function returns t if object is a face, else nil.

Function: copy-face old-face new-name &optional locale tag-set exact-p how-to-add

This function defines a new face named new-name which is a copy of the existing face named old-face. If there is already a face named new-name, then it alters the face to have the same properties as old-face.

locale, tag-set, exact-p and how-to-add let you copy just parts of the old face rather than the whole face, and are as in copy-specifier (see Specifiers).


Next: , Previous: , Up: Faces   [Contents][Index]