emacs-devel
[Top][All Lists]
Advanced

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

Re: +face-remapping-20040505-0.patch


From: Miles Bader
Subject: Re: +face-remapping-20040505-0.patch
Date: Fri, 7 May 2004 21:39:40 -0400
User-agent: Mutt/1.3.28i

On Fri, May 07, 2004 at 09:20:33PM -0400, Richard Stallman wrote:
>     >> This specification uses the first face in the list, NEW-FACE, last.  I
>     >> think it should use these faces in the order they appear.
> 
>     It should work the same way as when a list of faces is specified in the
>     `face' property, shouldn't it ?
> 
> I think we're saying the same thing in different words.

I'm not sure.

The code currently uses the same function that face-inheritance uses (a
face's :inherit attribute may be a list).  Unfortunately, the manner in which
that works is the _opposite_ of how a list of faces in a face property works.

 * In a face property, a list of faces is interpreted so that earlier faces in
   the list _override_ later faces in the list.

 * In an face-inheritance list, _later_ faces override earlier faces.

E.g., for a face property, the following face list:

   (variable-pitch fixed pitch)

will result in the display being `variable-pitch', but if the _same_ list
occurs in a face-inheritance property, the display will use `fixed-pitch'!

I'm not sure what to do about this; both behaviors kind of make sense.  The
:inherit behavior is somewhat closer to the implementation -- it just says
`merge these faces one by one' -- whereas perhaps the face-property behavior
of preferring earlier faces could seem more natural when viewed abstractly,
but is actually a bit more of a pain to implement (it uses recursion to apply
the face list in reverse order).

Use the same code as the face-property for `face-remapping-alist' would have
the advantage that you could use other `magic' face-property values for free,
e.g. directly embedded attributes like (:foreground "green"), but if that
were the case maybe the name `face-remapping-alist' would be slightly wrong?

Along the same lines, perhaps one or the other of the two existing types of
face-lists should be changed to be consistant with the other -- but which
one?

Any thoughts?

Thanks,

-Miles
-- 
Would you like fries with that?




reply via email to

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