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.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 51595 <at> debbugs.gnu.org
Subject: 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.




This bug report was last modified 3 years and 198 days ago.

Previous Next


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