Subject: Re: bug#6767: 24.0.50; face-all-attributes returns unspecified for everything

From: Jan Djärv <[email-masked]>
Date: Sat, 31 Jul 2010 15:22:03 +0200

Eli Zaretskii skrev 2010-07-31 13.11:
>> Date: Sat, 31 Jul 2010 11:36:52 +0200
>> From: Jan Djärv<[email-masked]>
>> Cc:
>>
>> In *scratch*:
>> (face-attribute 'italic :slant)
>> italic ;; Good.
>>
>> (face-italic-p 'italic)
>> (italic oblique) ;; Fine.
>>
>> (assq :slant (face-all-attributes 'italic))
>> (:slant . unspecified) ;; Say what??
>>
>> In fact face-all-attributes gives me unspecified for all attributes in
>> the faces I tried (about 5), including the default face.
>
> This happens because face-new-frame-defaults has `unspecified' for all
> the attributes of `italic' face (and all other faces as well).  Try
>
>    (face-all-attributes 'italic (selected-frame))
>
> and you will get what you expect.
>
>> Did I misunderstand how face-all-attributes work?
>
> I don't know, but it sounds like the doc string is at least misleading
> in this regard.  OTOH, this function is not used anywhere in Emacs, so
> it could be buggy.
>
> What is your use-case, exactly?

Just trying to get all attributes for a possible conversion to pango markup. 
I intend to use it for tooltips so Emacs can use the system tooltips instead 
of its own.  In principle it is possible to put properties on the tool tip 
string so I'm trying to handle that.  Maybe this is overkill, most toolstips 
in Emacs are straight strings, but I've seen bold and italic.  I can ask for 
specific attributes instead of using face-all-attributes.

An improvement for the documentation would be to refer to face-attribute and 
say that if frame is nil or omitted, face-attribute is called with frame 
argument t.

	Jan D.