Changing faces - ECB - the Emacs Code Browser
Description: ECB - the Emacs Code Browser

Next: Small screens, Previous: Common use-cases, Up: Common use-cases

### 10.1 Changing faces in the ECB tree-buffers

There are two basic faces:

- `ecb-default-general-face`: Basic face for displaying an ECB-tree-buffer.

  Itﾴs recommended to define the font-family, the font-size, the basic color etc. with this face.

  In GNU Emacs 21.X all faces (even the face `ecb-default-highlight-face`) used in the ECB tree-buffers inherit from this face. Therefore the default attributes like font etc. of a face used in a tree-buffer can be very easily changed with face `ecb-default-general-face`.

  With XEmacs there is no inheritance-feature but the options `ecb-directories-general-face`, `ecb-sources-general-face`, `ecb-methods-general-face` and `ecb-history-general-face` offer the choice to use the face `ecb-default-general-face` so also with XEmacs the basic face-settings can be easily changed just by customizing the face `ecb-default-general-face`.

- `ecb-default-highlight-face`: Basic face for highlighting the current node in an ECB-tree-buffer.

  In GNU Emacs 21.X all highlighting faces used in the ECB tree-buffers inherit from this face. Therefore the default attributes like font etc. of a highlighting face used in a tree-buffer can be very easily changed with face `ecb-default-highlight-face`.

  With XEmacs there is no inheritance-feature but the options `ecb-directory-face`, `ecb-source-face`, `ecb-method-face` and `ecb-history-face` offer the choice to use the face `ecb-default-highlight-face` so also with XEmacs the basic face-settings can be easily changed just by customizing the face `ecb-default-highlight-face`.

With these faces you can change the basic attributes easily and fast for ALL ECB-tree-buffers. But you are also able to display each ECB-tree-buffer with different faces, see the different options for every tree-buffer mentioned above.

Please note (only for XEmacs users): Cause of the lack of the font-inheritance feature using ONE other font for the ECB-methods buffer can NOT be achieved just by setting `ecb-methods-general-face` to `ecb-default-general-face` and changing the font of this default face. In addition you have to set the same font also for the face `ecb-bucket-node-face` like in the following example:

       (defconst my-ecb-font
                 "-outline-Courier-normal-normal-13-97-96-96-c-*-iso8859-1")
       (set-face-font 'ecb-default-general-face my-ecb-font)
       (set-face-font 'ecb-bucket-node-face my-ecb-font)

This code sets the new defined font `my-ecb-font` as font for all1 ECB-tree-buffers (incl. the methods buffer).

#### Footnotes

[1] Of course `ecb-directories-general-face`, `ecb-sources-general-face`, `ecb-methods-general-face` and `ecb-history-general-face` must be set to `ecb-default-general-face`!