Subject: RE: [External] : Re: bug#51465: 27.2; `face-all-attributes' doc or behavior (?)

From: Drew Adams <[email-masked]>
Date: Thu, 28 Oct 2021 23:08:42 +0000

> > (elisp) `Attribute Functions' says "the default attributes of FACE
> > for newly created frames".  I would expect to see :background as
> > "LightGoldenrod", not as `unspecified'.
> 
> Why? because that's what you actually see in a new frame?  Those
> aren't the default attributes, those are the attributes specified by
> defface.

The Elisp manual says it returns "the default attributes
of FACE for newly created frames."

Whenever I create a new frame (from emacs -Q) that face
on that frame has a :background of "LightGoldenrod" -
never `unspecified'.  Is the manual wrong?  Or are the
manual and the doc string trying to say the same thing
but ending up suggesting different things?

To me, the manual's text suggests I'd expect to see
"LightGoldenrod", with emacs -Q, based on a GUI Emacs.
The defface for `region' and a light background with at
least 88 colors specifies "lightgoldenrod2".

> > Why would one want to get a list of the face's attributes
> > with every attribute value as `unspecified'?
> 
> I don't know.  I guess those defaults are not very interesting,
> indeed.

Unless otherwise specified (which could be by
`default-frame-alist' or whatever) a newly created
frame has, according to the manual, the attributes
for that face that are given by `face-all-attributes'
when that function is passed a nil FRAME arg: "the
default attributes of FACE for newly created frames."

IOW, it calls this "the default attributes" for
"newly created frames", not the attributes for some
existing frame (this is the FRAME=nil case).

And yet, with emacs -Q, every newly created frame
has :background set to "LightGoldenrod" (AFAICT).
At the very least, most, if not all, newly created
frames have that attribute value.  None have that
attribute with a value of `unspecified'.

The function returns `unspecified' as the default
for newly created frames (for this FACE's background).
But it seems that the actual default for newly
created frames is "LightGoldenrod".  Perhaps there
are multiple, unexplained meanings of "default"
involved here?

I'd think that "default" would just mean what you
get for a newly created frame unless there is
something that overrides that somehow.  I'd think
that "default" is what the current customized value
of the face has - that's what you get by default for
a newly created frame (or if it's not customized
then the value given by the original defface).

I'm hoping you at least see a possibility for
confusion in the doc.  And maybe even a problematic
behavior (what's the point of returning `unspecified'
everywhere?).
____

You didn't address my question about the seeming
impedance mismatch between what `set-face-attribute'
accepts as a list of attributes and what
`face-all-attributes' returns as a list of attributes.
So I submitted a separate bug report for that: #51469.