RE: facemenu-unlisted-faces

From:

Drew Adams

Subject:

RE: facemenu-unlisted-faces

Date:

Fri, 14 Jul 2006 08:06:24 -0700

> IOW, the usefulness you describe for face `fixed-pitch' is an
> argument for its existence as a face, but as a *constant* face.
> Since it is specifically intended to have a constant appearance
> (its particular appearance is its raison d'etre), changing its
> appearance should somehow be discouraged or prevented.
That doesn't make the least bit of sense -- 90% of the _reason_ for
having a face like `fixed-pitch' is so that the user can change it!
In a very narrow way (see below). 99.99% of the definition of this face is
*not* intended to be changed by users or code.
There are various place in emacs that want a fixed-pitch font: by
inheriting from `fixed-pitch', there's no need for the user to customize
all those faces if he wants to change which fixed-pitch font gets used
in general; he can just customize `fixed-pitch'.
I already mentioned the advantage of inheritance from `fixed-pitch'. That's
part of the "argument for its existence as a face". The same advantage is
present, however, if you inherit from a constant face.
Anyway, you raise a good point, even if it is a nuance. Face `fixed-pitch'
is a bit different from faces such as `bold'. In the case of `fixed-pitch',
the intention is not that the face definition (and its appearance) remain
100% constant, but that it remain constant *except* for the :font-family
attribute, and for the :font-family, the intention is that only a
fixed-pitch family be allowed. IOW, you can substitute a different
fixed-pitch font family for Courier, but that's the only way you're supposed
to change the definition of `fixed-pitch'. It's intended to be a very
constant face, but there is a tiny exception.
We're far from being able to specify fine-grained constraints like that,
alas. Which do you think is more important, 1) the fact that the face is
(intended to be) essentially constant (all attributes except :font-family,
and even that is restricted), or 2) the fact that some variability is
allowed? Would you toss it in the `dired-flagged' camp or the `bold' (face)
camp - `defface' or `defconst-face'?
I'd say, given the lack of a mechanism to precisely state and control the
intention, that the best solution is to use an analog of `defconst', and to
express the particular exceptions (your nuance) in the doc string.
There is a world of difference between the intention behind `fixed-pitch'
and the intention behind `dired-flagged'. There is less difference between
face `fixed-pitch and a face such as `bold' that is intended to remain 100%
constant. `fixed-pitch' is a face whose meaning, like that of face `bold',
is based on its appearance, not on its use. Its appearance is (intended to
be) essentially constant.