[Top][All Lists]

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

RE: Simplification of faces

From: Drew Adams
Subject: RE: Simplification of faces
Date: Mon, 1 Oct 2007 11:18:02 -0700

>     > I am thinking of essentially eliminating the face
>     > attributes as a way to control what a face looks like.
>     > Programs would use only `defface' and `face-spec-set'.
>     What about `modify-face'?
> `modify-face' is another interface to `set-face-attribute'.  Under
> this proposal, we would get rid of both.

Could you give a simple example of how a current use of `modify-face' would
be replaced with a call to `face-spec-set' or `defface' in your proposal?

I have nothing against doing things differently; I just want to know whether
and how I can still do what I do now (in some way). What I do now is change
only selected attributes of a face, leaving the rest as they were.

>     I'm not too clear on `face-spec-set'. Is what it does now is
>     replace only those attributes that are included in its SPEC arg,
>     leaving the others alone?
> That is what I thought yesterday from reading its code, but I see that
> in fact it calls `face-spec-reset-face'.  So it already does totally
> replace any other settings for that face.

That's what I thought.

See my proposal for `set-face', based on that understanding. AFAICT,
`face-spec-set' completely redefines an existing face, but it cannot be used
to create a new face.

For variables, we have `defvar' and `defcustom' that are analogous to
`defface', but we also have `setq', which is not analogous to
`face-spec-set', AFAICT: `setq' creates a variable if it did not already
exist. What I was asking for was an equivalent of `setq' for faces. Perhaps
`face-spec-set' could be redefined to do that, or a new function `set-face'
could be defined to do that.

> So this proposal therefore reduces to eliminating the
> `set-face-attribute' level of interface for controlling faces.
>     I hope that I will at least be able to still use
>     `modify-face'.
> Why do you want to use `modify-face'?

To modify a face. ;-)
To modify it only partly - only some attributes.

I have nothing against doing that some other way, but how to do that with
`face-spec-set' is not clear to me. Suppose, for instance, that I just want
to set (e.g. replace) the foreground color. How would I call `face-spec-set'
to do that (and still leave the rest of the face as it was defined?

reply via email to

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