unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI
@ 2021-11-03 21:09 Drew Adams
  2021-11-03 22:13 ` Stefan Kangas
  2021-11-04  6:49 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2021-11-03 21:09 UTC (permalink / raw)
  To: 51595

emacs -Q

(defface foo '((t :background "LightBlue")) "DOC ..." :group 'faces)
(defface bar '((t :foreground unspecified :background "LightBlue"))
  "DOC..." :group 'faces)

`M-x customize-face foo' shows the UI for the attributes of the face.

`M-x customize-face bar' shows only the Lisp value of the face spec.  A
user has no way to get from there to showing all of the attributes.
There's no way to edit the face.

The doc (Elisp manual) draws no such distinction - speaks of no such
limitation.  It just lists `unspecified' as one of the possible face
attributes:

  "Apart from the values given below, each face attribute can have the
   value 'unspecified'."

This looks like a lacuna in the UI.  You can specify `unspecified' in a
`defface', and the face is perfectly usable and well-defined, but users
can't edit it - can't manipulate its attributes.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19042
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI
  2021-11-03 21:09 bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI Drew Adams
@ 2021-11-03 22:13 ` Stefan Kangas
  2021-11-04  6:49 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2021-11-03 22:13 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51595

tags 51595 + confirmed
found 51595 29.0.50
thanks

Drew Adams <drew.adams@oracle.com> writes:

> emacs -Q
>
> (defface foo '((t :background "LightBlue")) "DOC ..." :group 'faces)
> (defface bar '((t :foreground unspecified :background "LightBlue"))
>   "DOC..." :group 'faces)
>
> `M-x customize-face foo' shows the UI for the attributes of the face.
>
> `M-x customize-face bar' shows only the Lisp value of the face spec.  A
> user has no way to get from there to showing all of the attributes.
> There's no way to edit the face.
>
> The doc (Elisp manual) draws no such distinction - speaks of no such
> limitation.  It just lists `unspecified' as one of the possible face
> attributes:
>
>   "Apart from the values given below, each face attribute can have the
>    value 'unspecified'."

(That's in (info "(elisp) Face Attributes").)

> This looks like a lacuna in the UI.  You can specify `unspecified' in a
> `defface', and the face is perfectly usable and well-defined, but users
> can't edit it - can't manipulate its attributes.

I can reproduce this on current master.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI
  2021-11-03 21:09 bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI Drew Adams
  2021-11-03 22:13 ` Stefan Kangas
@ 2021-11-04  6:49 ` Eli Zaretskii
  2021-11-04 17:58   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-11-04  6:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51595

> From: Drew Adams <drew.adams@oracle.com>
> Date: Wed, 3 Nov 2021 21:09:41 +0000
> 
> emacs -Q
> 
> (defface foo '((t :background "LightBlue")) "DOC ..." :group 'faces)
> (defface bar '((t :foreground unspecified :background "LightBlue"))
>   "DOC..." :group 'faces)

Don't do that.  Using 'unspecified' in user code is an error.  Patches
to the docs to that effect are welcome.

> The doc (Elisp manual) draws no such distinction - speaks of no such
> limitation.  It just lists `unspecified' as one of the possible face
> attributes:
> 
>   "Apart from the values given below, each face attribute can have the
>    value 'unspecified'."

"Can have" is a notice to Lisp programmers to expect such a value, it
is not an invitation to use it in defface or any other face specs.
the correct way of not specifying a value is to use nil or (better)
not to mention the attribute at all.  Think about how Emacs merges
faces, and you will understand why.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI
  2021-11-04  6:49 ` Eli Zaretskii
@ 2021-11-04 17:58   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-04 17:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51595

Eli Zaretskii <eliz@gnu.org> writes:

> "Can have" is a notice to Lisp programmers to expect such a value, it
> is not an invitation to use it in defface or any other face specs.

So I've now mentioned this in the manual, and I'm therefore closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-04 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 21:09 bug#51595: 26.3; Face attribute value `unspecified' in `defface' breaks Customize UI Drew Adams
2021-11-03 22:13 ` Stefan Kangas
2021-11-04  6:49 ` Eli Zaretskii
2021-11-04 17:58   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).