GNU bug report logs -
#6767
24.0.50; face-all-attributes returns unspecified for everything
Previous Next
Reported by: Jan Djärv <jan.h.d <at> swipnet.se>
Date: Sat, 31 Jul 2010 09:37:02 UTC
Severity: normal
Found in version 24.0.50
Done: Jan Djärv <jan.h.d <at> swipnet.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii skrev 2010-07-31 13.11:
>> Date: Sat, 31 Jul 2010 11:36:52 +0200
>> From: Jan Djärv<jan.h.d <at> swipnet.se>
>> 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.
This bug report was last modified 15 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.