[Top][All Lists]

[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 10:38:35 +0100

>>>>> "Miles" == Miles Bader <address@hidden> writes:

    Miles>   (defun face-attribute (face attribute &optional frame
    Miles> inherit) "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 defaults
    Miles> for face FACE (for new frames).  If FRAME is omitted or
    Miles> 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 non-nil,
    Miles> FACE's definition of ATTRIBUTE is merged with the faces
    Miles> specified by its `:inherit' attribute; however the return
    Miles> value may still be `unspecified' or relative.  If INHERIT
    Miles> is a face or a list of faces, then the result is further
    Miles> merged with that face (or faces), until it becomes
    Miles> specified and absolute.

    Miles>   To ensure that the return value is always specified and
    Miles> absolute, use a value of `default' for INHERIT; this will
    Miles> resolve any unspecified or relative values by merging with
    Miles> the `default' face (which is always completely specified)."
    Miles> ...)

    Miles> [`face-foreground', `face-background', and `face-stipple'
    Miles> are similarly changed]

    Miles> Does this seem like it addresses your problem?

While it does, I beg to differ from your opinion of this being a minor
issue not worth having been solved before 21.1.  Getting at actual
effective font parameters is important for any application making use
of these features.  This way, I have to either
a) program the complete lookup stuff myself,
b) tell people that my software will not work with Emacs-21.1 due to
missing basic features, even though 21.1 is the first officially
released version of Emacs-21.

And I'll probably have to check myself whether Emacs already supports
the additional argument and use it only if available.

Well, little use to shed tears over spilled milk.

Is there a better way of doing that other than just trying it
cushioned by condition-case and doing it the hard way when receiving
an error?

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

reply via email to

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