4

I often find that I need to define faces for custom commands. I prefer to inherit from faces defined by the current theme, to keep things visually consistent.

M-x list-faces-display lists the faces, but it doesn't display a preview. It's just a list of face names and then the alphabet, formatted with the default "link" face.

Is there a way for me to easily visualise what faces are defined by the current theme? Is there a way for me to easily visualise all currently defined faces across the board?


Edit: M-x list-faces-display is not giving me a preview. Here is what it looks like with the leuven theme:

<code>list-faces-display</code> under the Leuven theme

And here is what it looks like with zenburn:

<code>list-faces-display</code> under the Zenburn theme

If I disable my init file, I can get previews working again. The previews do actually appear to be in the correct face, but they are displaying as buttons. Is there any reason having the button property set to t or being in the help-face-button category would override the underlying face?

3
  • 2
    It may behoove you to recursively bisect your user-configuration (by commenting stuff out and restarting Emacs) to find out why list-faces-display works correctly with emacs -q, but not when loading your user-configuration. The right column should be a rainbow of colors, with a variety of fonts.
    – lawlist
    Commented Sep 26, 2016 at 16:52
  • I haven't messed about with text properties myself but if all else fails I will. Each of the text previews is in the relevant font when I inspect the text. However, they are displaying as button. Is there any reason having the button property set to t would override the default face? Is there a way to manually override that? I'd rather apply a patch to whatever changed that than disable packages outright.
    – JCC
    Commented Sep 26, 2016 at 17:02
  • In my emacs, the button property is indeed set on the sample texts, because they are indeed buttons. But also, the face property is set to the face being displayed, and that determines the look of the text. Before bisecting, try to run emacs with the -Q argument. If the problem still occurs, your emacs installation appears to be broken somehow. Commented Sep 26, 2016 at 21:01

1 Answer 1

6

To see all faces currently defined: M-x list-faces-display. It does show a preview. It does not show the samples using the "default 'link' face".

The Emacs manual, as usual, is your friend. C-h r i face TAB, choose faces.

That takes you to node Faces.


If you use library Facemenu+ then list-faces-display is enhanced a bit.

2
  • M-x list-faces-display is not showing a preview on my box. It works if I disable my init file, otherwise it displays with face button. I've added some screenshots. There are no hooks or anything that modify how faces are displayed, and previews work in the customize menu and individual face help menus.
    – JCC
    Commented Sep 26, 2016 at 16:51
  • 3
    Clearly, something in your init file is causing you the grief. As usual, recursively bisect it until you find the culprit. You can use M-x comment-region to comment-out the region. And with plain C-u the command UNcomments the region. This is a binary search, so it is very quick to do (even if it doesn't seem like it at first).
    – Drew
    Commented Sep 26, 2016 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.