0

Defining Faces - GNU Emacs Lisp Reference Manual says that a face name should not end in -face, but when I run list-faces-display there are some face names that end with that. If I were to write a package which uses its own faces, should I use the -face suffix?

What about user variables that hold faces? Should the variable names end in -face?

Drew
  • 29,895
  • 7
  • 74
  • 104
Jisang Yoo
  • 3,670
  • 20
  • 31

1 Answers1

2

If the manual says that you shouldn't do it, don't do it. The ones that end with -face are old holdovers that were written before the rule came into place, and haven't been rewritten yet.

The variables that hold faces is something similar to a box that can hold exactly one box of the same size. Not very useful. You can get by without them, I think.

abo-abo
  • 20,038
  • 3
  • 50
  • 71
  • I believe the point of variables that hold faces is that you can change which face is used without actually changing the face definition. This can certainly be useful if a given face is utilised in multiple places and you only want to change the appearance in some of them (although it's undoubtedly true that this flexibility is not needed in all cases). In response to the original question, I would certainly recommend that such variables end in `-face`, as that is clearly the normal convention. – phils Sep 15 '13 at 13:20
  • Both @abo-abo and @phils are correct. There is still a use for such variables, as @phils explained. But in the past there were also some such variables that were not needed. And in the past there were also face names that had the suffix `-face`. – Drew Sep 15 '13 at 15:37
  • 1
    Face variables are much less useful now that you can get the same result via `face-remap-alist`. – Stefan Sep 16 '13 at 02:04