* A question about face-all-attributes
@ 2013-10-23 13:49 Xue Fuqiao
2013-10-23 15:42 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Xue Fuqiao @ 2013-10-23 13:49 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I'm experimenting with faces in Emacs Lisp now, but I don't understand
this piece of code:
(face-all-attributes 'default)
=>
((:family . unspecified) (:foundry . unspecified) (:width .
unspecified) (:height . unspecified) (:weight . unspecified) (:slant .
unspecified) (:underline . unspecified) (:overline . unspecified)
(:strike-through . unspecified) (:box . unspecified) (:inverse-video .
unspecified) (:foreground . unspecified) ...)
But:
(describe-face 'default)
=>
Family: Ubuntu Mono
Foundry: unknown
Width: normal
Height: 128
...
Why are the two results different? I expected similar results from
them. I searched ‘face-all-attributes’ but found no document matching
my query. Can anyone point me in the right direction?
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A question about face-all-attributes
2013-10-23 13:49 A question about face-all-attributes Xue Fuqiao
@ 2013-10-23 15:42 ` Eli Zaretskii
2013-10-24 10:47 ` Xue Fuqiao
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-10-23 15:42 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Wed, 23 Oct 2013 21:49:28 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
>
> (face-all-attributes 'default)
> =>
> ((:family . unspecified) (:foundry . unspecified) (:width .
> unspecified) (:height . unspecified) (:weight . unspecified) (:slant .
> unspecified) (:underline . unspecified) (:overline . unspecified)
> (:strike-through . unspecified) (:box . unspecified) (:inverse-video .
> unspecified) (:foreground . unspecified) ...)
>
> But:
>
> (describe-face 'default)
> =>
> Family: Ubuntu Mono
> Foundry: unknown
> Width: normal
> Height: 128
> ...
>
> Why are the two results different? I expected similar results from
> them.
If the results were similar, the existence of describe-face would not
have been justified. It exists to show you what the default
attributes really will be.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A question about face-all-attributes
2013-10-23 15:42 ` Eli Zaretskii
@ 2013-10-24 10:47 ` Xue Fuqiao
2013-10-24 15:25 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Xue Fuqiao @ 2013-10-24 10:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Wed, Oct 23, 2013 at 11:42 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> (face-all-attributes 'default)
>> =>
>> ((:family . unspecified) (:foundry . unspecified) (:width .
>> unspecified) (:height . unspecified) (:weight . unspecified) (:slant .
>> unspecified) (:underline . unspecified) (:overline . unspecified)
>> (:strike-through . unspecified) (:box . unspecified) (:inverse-video .
>> unspecified) (:foreground . unspecified) ...)
>>
>> But:
>>
>> (describe-face 'default)
>> =>
>> Family: Ubuntu Mono
>> Foundry: unknown
>> Width: normal
>> Height: 128
>> ...
>>
>> Why are the two results different? I expected similar results from
>> them.
>
> If the results were similar, the existence of describe-face would not
> have been justified. It exists to show you what the default
> attributes really will be.
Thanks, Eli. But in (info "(elisp) Face Attributes"):
An ‘unspecified’ attribute tells Emacs to refer instead to a parent
face; or, failing that, to an underlying face. The ‘default’ face
must specify all attributes.
But all the attributes returned by face-all-attributes are
‘unspecified’, why?
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A question about face-all-attributes
2013-10-24 10:47 ` Xue Fuqiao
@ 2013-10-24 15:25 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2013-10-24 15:25 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Thu, 24 Oct 2013 18:47:59 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>
> On Wed, Oct 23, 2013 at 11:42 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> >> (face-all-attributes 'default)
> >> =>
> >> ((:family . unspecified) (:foundry . unspecified) (:width .
> >> unspecified) (:height . unspecified) (:weight . unspecified) (:slant .
> >> unspecified) (:underline . unspecified) (:overline . unspecified)
> >> (:strike-through . unspecified) (:box . unspecified) (:inverse-video .
> >> unspecified) (:foreground . unspecified) ...)
> >>
> >> But:
> >>
> >> (describe-face 'default)
> >> =>
> >> Family: Ubuntu Mono
> >> Foundry: unknown
> >> Width: normal
> >> Height: 128
> >> ...
> >>
> >> Why are the two results different? I expected similar results from
> >> them.
> >
> > If the results were similar, the existence of describe-face would not
> > have been justified. It exists to show you what the default
> > attributes really will be.
>
> Thanks, Eli. But in (info "(elisp) Face Attributes"):
>
> An ‘unspecified’ attribute tells Emacs to refer instead to a parent
> face; or, failing that, to an underlying face. The ‘default’ face
> must specify all attributes.
>
> But all the attributes returned by face-all-attributes are
> ‘unspecified’, why?
Evidently, the manual is blatantly wrong. Unless this is an
unfortunate combination of using `unspecified' in the first sentence
and `specify' in the second, which does not necessarily mean "cannot
use `unspecified' in the 'default' face."
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-24 15:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 13:49 A question about face-all-attributes Xue Fuqiao
2013-10-23 15:42 ` Eli Zaretskii
2013-10-24 10:47 ` Xue Fuqiao
2013-10-24 15:25 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).