emacs-devel
[Top][All Lists]
Advanced

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

Re: face-attribute returns wrong foreground color for inheriting face.


From: David Kastrup
Subject: Re: face-attribute returns wrong foreground color for inheriting face.
Date: 28 Oct 2001 13:39:45 +0100

    Miles> The following is my proposed change to the `face-attribute'
    Miles> function to provide a solution to this problem.  I
    Miles> basically added the INHERIT parameter:

    Miles>   (defun face-attribute (face attribute &optional frame inherit)
    Miles>     "Return the value of FACE's ATTRIBUTE on FRAME.

    Miles>   If the optional argument FRAME is given, report on face
    Miles>   FACE in that frame.  If FRAME is t, report on the
    Miles>   defaults for face FACE (for new frames).  If FRAME is
    Miles>   omitted or nil, use the selected frame.

    Miles>   If INHERIT is nil, only attributes directly defined by
    Miles>   FACE are considered, so the return value may be
    Miles>   `unspecified', or a relative value.  If INHERIT is
    Miles>   non-nil, FACE's definition of ATTRIBUTE is merged with
    Miles>   the faces specified by its `:inherit' attribute; however
    Miles>   the return value may still be `unspecified' or relative.
    Miles>   If INHERIT is a face or a list of faces, then the result
    Miles>   is further merged with that face (or faces), until it
    Miles>   becomes specified and absolute.

Ok, I need to get this straight:

The :inherit attribute conceptually defines a tree of inheritance
where all leaves at a given level are mentioned in a face's :inherit
attribute.  The :inherit attribute is supposed to define attributes
not defined by the font itself.  What happens if the font defines a
*relative* value for an attribute?  Will the :inherit tree be
consulted for further resolution of that size?  If so, in case it
leads to relative specs again, what will be taken into account?  The
first path resolving to a relative or absolute value only, or will the
entire :inherit tree be merged with regard to relative sizes?  If the
result of consulting the :inherit tree is relative again, and the
INHERIT argument contains several faces with relative specs, will the
relative specs be combined, or will only the first absolute spec
count?

In other words: does the INHERIT spec translate to a single branch in
an inheritance tree, or to alternate branches?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: address@hidden



reply via email to

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