[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Stefan Monnier
Subject: bug#11059: 24.0.94; Please add `face-spec-set' to the elisp manual
Date: Thu, 12 Apr 2012 12:04:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

>> 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.

I find most of those inconvenient, tho.

> 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 think the problem is not so much the difference between the two, as
the fact that most of the ways you mentioned above deal with the
low-level face attributes, and these are tricky to use in
multi-frame setups.

> 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

That's an option.  But another option is to leave the C code as-is and
simply consider all operations that apply at the level of face
attributes to be "low-level, for internal use only", and the only
advertized operations to be in terms of face specs.  After all, whether
the "interpretation/elaboration" of the face specs is done at
frame-creation time in Elisp, or some other way in C is not
that important.

A good step in that direction is a "setq-default" for faces which takes
a face spec, and we could call it custom-set-face.  Of course, another
name would work fine.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]