(lemacs.info)Faces


Prev: Audible Bell Up: Customization

Faces
=====

   Lucid Emacs has objects called extents and faces.  An "extent" is a
region of text and a "face" is a collection of textual attributes, such
as fonts and colors.  Every extent is displayed in some face;
therefore, changing the properties of a face immediately updates the
display of all associated extents.  Faces can be screen-local: you can
have a region of text that displays with completely different
attributes when its buffer is viewed from a different X window.

   The display attributes of faces may be specified either in Lisp or
through the X resource manager.

Customizing Faces
-----------------

   You can change the face of an extent with the functions in this
section.  All the functions prompt for a FACE as an argument; use
completion for a list of possible values.

`M-x invert-face'
     Swap the foreground and background colors of the given FACE.

`M-x make-face-bold'
     Make the font of the given FACE bold.  When called from a program,
     returns `nil' if this is not possible.

`M-x make-face-bold-italic'
     Make the font of the given FACE bold italic.  When called from a
     program, returns `nil' if not possible.

`M-x make-face-italic'
     Make the font of the given FACE italic.  When called from a
     program, returns `nil' if not possible.

`M-x make-face-unbold'
     Make the font of the given FACE non-bold.  When called from a
     program, returns `nil' if not possible.

`M-x make-face-unitalic'
     Make the font of the given FACE non-italic.  When called from a
     program, returns `nil' if not possible.

`M-x make-face-larger'
     Make the font of the given FACE a little larger.  When called from
     a program, returns `nil' if not possible.

`M-x make-face-smaller'
     Make the font of the given FACE a little smaller.  When called
     from a program, returns `nil' if not possible.

`M-x set-face-background'
     Change the background color of the given FACE.

`M-x set-face-background-pixmap'
     Change the background pixmap of the given FACE.

`M-x set-face-font'
     Change the font of the given FACE.

`M-x set-face-foreground'
     Change the foreground color of the given FACE.

`M-x set-face-underline-p'
     Change whether the given FACE is underlined.

   You can exchange the foreground and background color of the selected
FACE with the function `invert-face'. If the face does not specify both
foreground and background, then its foreground and background are set
to the background and foreground of the default face.  When calling
this from a program, you can supply the optional argument SCREEN to
specify which screen is affected; otherwise, all screens are affected.

   You can set the background color of the specified FACE with the
function `set-face-background'.  The argument `color' should be a
string, the name of a color.  When called from a program, if the
optional SCREEN argument is provided, the face is changed only in that
screen; otherwise, it is changed in all screens.

   You can set the background pixmap of the specified FACE with the
function `set-face-background-pixmap'.  The pixmap argument NAME should
be a string, the name of a file of pixmap data.  The directories listed
in the `x-bitmap-file-path' variable are searched.  The bitmap may also
be a list of the form `(WIDTH HEIGHT DATA)', where WIDTH and HEIGHT are
the size in pixels, and DATA is a string containing the raw bits of the
bitmap.  If the optional SCREEN argument is provided, the face is
changed only in that screen; otherwise, it is changed in all screens.

   The variable `x-bitmap-file-path' takes as a value a list of the
directories in which X bitmap files may be found.  If the value is
`nil', the list is initialized from the `*bitmapFilePath' resource.

   If the environment variable XBMLANGPATH is set, then it is consulted
before the `x-bitmap-file-path' variable.

   You can set the font of the specified FACE with the function
`set-face-font'.  The FONT argument should be a string, the name of a
font.  When called from a program, if the optional SCREEN argument is
provided, the face is changed only in that screen; otherwise, it is
changed in all screens.

   You can set the foreground color of the specified FACE with the
function `set-face-foreground'.  The argument COLOR should be a string,
the name of a color.  If the optional SCREEN argument is provided, the
face is changed only in that screen; otherwise, it is changed in all
screens.

   You can set underline the specified FACE with the function
`set-face-underline-p'. The argument UNDERLINE-P can be used to make
underlining an attribute of the face or not. If the optional SCREEN
argument is provided, the face is changed only in that screen;
otherwise, it is changed in all screens.

X Resources
===========

   The Emacs resources are generally set per-screen. Each Emacs screen
can have its own name or the same name as another, depending on the
name passed to the `x-create-screen' function.

   You can specify resources for all screens with the syntax:

     Emacs*parameter: value

or

     Emacs*EmacsScreen*parameter:value

   You can specify resources for a particular screen with the syntax:

     Emacs*SCREEN-NAME*parameter: value

To make the default size of all Emacs screens 80 columns by 55 lines,
set the resource this way:

     Emacs*EmacsScreen*geometry: 80x55

As a special case, this geometry specification also works:

     Emacs.geometry: 80x55

since that is the syntax used with most other applications (since most
other applications have only one top-level window, unlike Emacs). In
general, however, the top-level shell does not have any interesting
resources on it, and you should set the resources on the screens
instead.  To set the geometry of a particular screen named `fred', do
this: `Emacs*fred.geometry: 80x55'.

   Important! Do not use the following syntax:

     Emacs*geometry: 80x55

You should never use `*geometry' with any X application. It does not
set the Emacs screen to be 80 columns by 55 lines. It actually sets all
Emacs screens and windows to be 80 by 35 in whatever units they care to
measure in. In particular, it tells the Emacs text pane to be 80 by 55
in characters and tells the menu bar pane to be 80 x 55 pixels, which
is probably not what you want.

   The `-geometry' command-line argument sets only the geometry of the
initial screen created by Emacs.

   Emacs screens accept the following resources:

`iconic' (class `Iconic'): boolean
     Whether the initial window should appear in the iconified state.

`internalBorderWidth' (class `InternalBorderWidth'): int
     How many blank pixels to leave between the text and the edge of the
     window.

`interline' (class `Interline'): int
     How many pixels to leave between each line.

`cursorColor' (class `CursorColor'): color-name
     The color of the text cursor.

`textPointer' (class `Cursor'): cursor-name
     The cursor to use when the mouse is over text.  This resource is
     used to initialize the variable `x-pointer-shape'.

`selectionPointer' (class `Cursor'): cursor-name
     The cursor to use when the mouse is over a selectable text region
     (an extent with the `highlight' property; for example, an Info
     cross-reference).  This resource is used to initialize the variable
     `x-selection-pointer-shape'.

`spacePointer' (class `Cursor'): cursor-name
     The cursor to use when the mouse is over a blank space in a buffer
     (that is, after the end of a line or after the end-of-file).  This
     resource is used to initialize the variable
     `x-nontext-pointer-shape'.

`modeLinePointer' (class `Cursor'): cursor-name
     The cursor to use when the mouse is over a mode line.  This
     resource is used to initialize the variable `x-mode-pointer-shape'.

`gcPointer' (class `Cursor'): cursor-name
     The cursor to display when a garbage-collection is in progress.
     This resource is used to initialize the variable
     `x-gc-pointer-shape'.

`scrollbarPointer' (class `Cursor'): cursor-name
     The cursor to use when the mouse is over the scrollbar.  This
     resource is used to initialize the variable
     `x-scrollbar-pointer-shape'.

`pointerColor' (class `Foreground'): color-name
`pointerBackground'(class `Background'): color-name
     The foreground and background colors of the mouse cursor.  These
     resources are used to initialize the variables
     `x-pointer-foreground-color' and `x-pointer-background-color'.

   The attributes of faces are also per-screen. They can be specified
as:

     Emacs*FACE_NAME.parameter: value

or

     Emacs*SCREEN_NAME*FACE_NAME.parameter: value

Faces accept the following resources:

`attributeFont' (class `AttributeFont'): font-name
     The font of this face.

`attributeForeground' (class `AttributeForeground'): color-name
`attributeBackground' (class `AttributeBackground'): color-name
     The foreground and background colors of this face.

`attributeBackgroundPixmap' (class `AttributeBackgroundPixmap'): file-name
     The name of an XBM file, to use as a background stipple.

`attributeUnderline' (class `AttributeUnderline'): boolean
     Whether text in this face should be underlined.

   All text is displayed in some face, defaulting to the face named
`default'.  To set the font of normal text, use
`Emacs*default.attributeFont'. To set it in the screen named `fred',
use `Emacs*fred*default.attributeFont'.

   These are the names of the predefined faces:

`default'
     Everything inherits from this.

`bold'
     If this is not specified in the resource database, Emacs tries to
     find a bold version of the font of the default face.

`italic'
     If this is not specified in the resource database, Emacs tries to
     find an italic version of the font of the default face.

`bold-italic'
     If this is not specified in the resource database, Emacs tries to
     find a bold-italic version of the font of the default face.

`modeline'
     This is the face that the modeline is displayed in.  If not
     specified in the resource database, it is determined from the
     default face by reversing the foreground and background colors.

`highlight'
     This is the face that highlighted extents (for example, Info
     cross-references and possible completions, when the mouse passes
     over them) are displayed in.

`left-margin'
`right-margin'
     These are the faces that the left and right annotation margins are
     displayed in.

`primary-selection'
     This is the face that mouse selections are displayed in.

`isearch'
     This is the face that the matched text being searched for is
     displayed in.

`info-node'
     This is the face of info menu items.  If unspecified, it is copied
     from `bold-italic'.

`info-xref'
     This is the face of info cross-references.  If unspecified, it is
     copied from `bold'. (Note that, when the mouse passes over a
     cross-reference, the cross-reference's face is determined from a
     combination of the `info-xref' and `highlight' faces.)

   Other packages might define their own faces; to see a list of all
faces, use any of the interactive face-manipulation commands such as
`set-face-font' and type `?' when you are prompted for the name of a
face.


automatically generated by info2www