bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51465: 27.2; `face-all-attributes' doc or behavior (?)


From: Drew Adams
Subject: bug#51465: 27.2; `face-all-attributes' doc or behavior (?)
Date: Thu, 28 Oct 2021 19:08:53 +0000

emacs -Q

Set eval-expression-print-length to nil for the session.

 (face-all-attributes 'region) ; C-x C-e

Shows all attributes, including :background, with value `unspecified'.

 (face-all-attributes 'region (selected-frame)) ; C-x C-e

Shows attribute :background with value "LightGoldenrod".

The doc string of `face-all-attributes' says that a nil second arg
means use "the default attributes".

What does that mean - what are the default attributes?  I was expecting
that it meant the default settings for the face: default set of
attributes with their default values for that face.

(elisp) `Attribute Functions' says "the default attributes of FACE for
newly created frames".  I would expect to see :background as
"LightGoldenrod", not as `unspecified'.

If arg FRAME is specified (as a frame) then the function returns the
attributes of FACE on FRAME.  Not sure what that means either - faces
have different attributes on different frames?

If I do `M-x customize-face region' from emacs -Q I see :background set
as "LightGoldenrod".  That command customizes the face for all frames,
no?  So doesn't that mean that the face has that background for all
frames (by default)?

Why would one want to get a list of the face's attributes with every
attribute value as `unspecified'?  More importantly, how to get the
actual (default) values "for all frames" - what you see when you use
`customize-face'?

I feel I must be missing something obvious, here.  But the Elisp manual
didn't make things any clearer.

___

You can let me know if the rest of this report should be posted as a
separate bug report.  But perhaps you could just let me know what I'm
missing in this regard too, if that's simple to do.

My question is why do we have the &rest argument ARGUMENTS of
`set-face-attribute' be a plist, but what `face-all-attributes' returns
is an alist?  Just to do something like the following isn't possible:

(apply #'set-face-attribute 'some-face
                            nil
                            (face-all-attributes 'other-face))

To accomplish that you need to convert the alist returned by
`face-all-attributes' to a plist, and pass that to `set-face-attribute'.
Why?  What other uses of these two functions would suggest that they
should use different ways to express the list of face attributes?


In GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26 built on CIRROCUMULUS
Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19042
System Description: Microsoft Windows 10 Pro (v10.0.2009.19042.1288)






reply via email to

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