GNU bug report logs - #51595
26.3; Face attribute value `unspecified' in `defface' breaks Customize UI

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 3 Nov 2021 21:10:02 UTC

Severity: normal

Tags: confirmed

Found in versions 29.0.50, 26.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51595 in the body.
You can then email your comments to 51595 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51595; Package emacs. (Wed, 03 Nov 2021 21:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 03 Nov 2021 21:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.3; Face attribute value `unspecified' in `defface' breaks
 Customize UI
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)

`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''





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51595; Package emacs. (Wed, 03 Nov 2021 22:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 51595 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 51595 <at> debbugs.gnu.org
Subject: Re: bug#51595: 26.3; Face attribute value `unspecified' in `defface'
 breaks Customize UI
Date: Wed, 3 Nov 2021 15:13:56 -0700
tags 51595 + confirmed
found 51595 29.0.50
thanks

Drew Adams <drew.adams <at> 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.




Added tag(s) confirmed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 03 Nov 2021 22:15:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 29.0.50. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 03 Nov 2021 22:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51595; Package emacs. (Thu, 04 Nov 2021 06:51:01 GMT) Full text and rfc822 format available.

Message #15 received at 51595 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 51595 <at> debbugs.gnu.org
Subject: Re: bug#51595: 26.3;
 Face attribute value `unspecified' in `defface' breaks Customize UI
Date: Thu, 04 Nov 2021 08:49:54 +0200
> From: Drew Adams <drew.adams <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51595; Package emacs. (Thu, 04 Nov 2021 18:00:02 GMT) Full text and rfc822 format available.

Message #18 received at 51595 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51595 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#51595: 26.3; Face attribute value `unspecified' in
 `defface' breaks Customize UI
Date: Thu, 04 Nov 2021 18:58:54 +0100
Eli Zaretskii <eliz <at> 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




bug marked as fixed in version 29.1, send any further explanations to 51595 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Nov 2021 18:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Dec 2021 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.