GNU bug report logs -
#63290
30.0.50; Customize UI shows extra fields for (choice (const ...) (alist ...))
Previous Next
Reported by: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Date: Fri, 5 May 2023 06:04:01 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 19 Aug 2023 11:34:24 +0300
with message-id <831qfz1ldb.fsf <at> gnu.org>
and subject line Re: bug#63290: 30.0.50; Customize UI shows extra fields for (choice (const ...) (alist ...))
has caused the debbugs.gnu.org bug report #63290,
regarding 30.0.50; Customize UI shows extra fields for (choice (const ...) (alist ...))
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
63290: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63290
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
This test case shows the issue:
(defcustom test-custom nil "" :type
'(choice (alist
:key-type (string :tag "key")
:value-type (string :tag "value"))
(const :tag "auto" nil)))
(customize-variable 'test-custom)
The UI first shows:
Hide Test Custom: Choice: Value Menu Alist:
INS
State : STANDARD.
Then if I choose "Value Menu", and option 1 to choose the "auto" const
value, I get:
Hide Test Custom: Choice: Value Menu auto
State : EDITED, shown value does not take effect until you set or save it.
which is fine. Then if I choose "Value Menu" again and choose 0 for the
Alist, I get:
Hide Test Custom: Choice: Value Menu Alist:
INS DEL key:
value:
INS
State : EDITED, shown value does not take effect until you set or save it.
I wasn't expecting:
INS DEL key:
value:
If I then save the customization, test-custom is ("" . ""). I think it
should instead be nil.
I noticed this on excorporate-configuration, which has:
(defcustom test-custom nil "" :type
'(choice (const :tag "auto" nil)
(alist
:key-type (string :tag "key")
:value-type (string :tag "value"))))
but where the alist is a large nested structure. If the user
customizes, test-custom, selects the alist, and saves, the structure has
degenerate ("" . ""), or (nil . nil) entries in it. To avoid this, the
user would have to hit "DEL" on the empty key/value entries, which is
not ideal.
It seems like after a const is shown, Customize considers the variable
"edited". I don't know why it is adding those extra INS/DEL key/value
UI boxes though.
Thomas
[Message part 3 (message/rfc822, inline)]
> Cc: 63290 <at> debbugs.gnu.org
> Date: Tue, 15 Aug 2023 19:46:35 -0300
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> So, in case the :value is missing for the alist widget, we want to
> compute the default-value with the :options, and without including the
> editable-list.
>
> Hopefully the attached patch is 100% correct now. I did try it with
> excorporate-configuration and I think it works OK, but please give it
> yourself a try. And thank you for your patience.
Thanks, I've now installed this on the master branch, and I'm closing
the bug.
This bug report was last modified 1 year and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.