Subject: bug#11059: 24.0.94; Please add `face-spec-set' to the elisp manual

From: Chong Yidong <[email-masked]>
Date: Thu, 12 Apr 2012 23:13:48 +0800

Stefan Monnier <[email-masked]> writes:

> Indeed, but this has some downsides: Custom may decide to rewrite your
> handwritten custom-set-faces.  We should document an Elisp way to
> configure faces, and I'd recommend a new function `custom-set-face'
> which works just like custom-set-faces except it applies to a single
> face and will be left alone by Custom.

We already have a multitude of Elisp ways to configure faces:
set-face-attribute, X resources, various frame parameters,
default-frame-alist, face-new-frame-defaults...  Throwing yet another
function into the current mix is not a pleasing prospect.

The issue is that, as you know, at a fundamental Emacs treats faces in
terms of face attributes; face *specs* are a higher-level construct
recognized only by the Custom system and the related frame creation
code.  So the equivalent of `setq-default' for faces is
`set-face-attribute', which works on attributes not specs.

I'd prefer reforming the system by changing the C code to understand and
store face specs.  Then the equivalent of `setq-default' for faces would
be to change an entry in `face-new-frame-defaults'---which would store
face specs rather than what vectors of attributes (almost all
unspecified) as it currently does.  Probably not difficult, but more
suitable for Emacs 25 than 24.2.