GNU bug report logs - #76181
30.0.93; defcustom is not ordering-agnostic

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Mon, 10 Feb 2025 16:02:01 UTC

Severity: normal

Tags: notabug

Found in version 30.0.93

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>, 76181 <at> debbugs.gnu.org
Subject: bug#76181: 30.0.93; defcustom is not ordering-agnostic
Date: Mon, 10 Feb 2025 13:19:14 -0300
Robert Pluim <rpluim <at> gmail.com> writes:

> (this is a reduced test case after I noticed
> `org-table-duration-custom-format' behaving funny.)
>
> emacs -Q -nw
> ;; evaluate the following defcustoms
>
> (defcustom this-is-broken 'one
>   "user option one"
>   :type '(choice
>           (symbol :tag "two" two)
> 	  (symbol :tag "one" one)))
>
> (defcustom this-is-ok 'one
>   "user option two"
>   :type '(choice
> 	  (symbol :tag "one" one)
>           (symbol :tag "two" two)))
>
> M-x customize-variable RET this-is-broken RET
>
> ;; The display is wrong, itʼs showing the "two" tag, but the correct
> ;; value:

For the 'choice type, manual says:

If some values are covered by more than one of the alternatives,
customize will choose the first alternative that the value fits.
This means you should always list the most specific types first,
and the most general last.

So this works as expected, a symbol matches a symbol widget, no matter
what the default value for that symbol widget is.

Alternative is to use const.




This bug report was last modified 151 days ago.

Previous Next


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