unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63290: 30.0.50; Customize UI shows extra fields for (choice (const ...) (alist ...))
@ 2023-05-05  6:02 Thomas Fitzsimmons
  2023-07-16 13:15 ` Mauro Aranda
  2023-08-21 12:23 ` Mattias Engdegård
  0 siblings, 2 replies; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-05  6:02 UTC (permalink / raw)
  To: 63290

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





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

end of thread, other threads:[~2023-08-21 15:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05  6:02 bug#63290: 30.0.50; Customize UI shows extra fields for (choice (const ...) (alist ...)) Thomas Fitzsimmons
2023-07-16 13:15 ` Mauro Aranda
2023-07-17  2:37   ` Thomas Fitzsimmons
2023-08-09 12:19   ` Mauro Aranda
2023-08-09 12:53     ` Eli Zaretskii
2023-08-09 15:51     ` Thomas Fitzsimmons
2023-08-09 15:56       ` Mauro Aranda
2023-08-09 18:03       ` Mauro Aranda
2023-08-10 22:58       ` Mauro Aranda
2023-08-11 13:29         ` Thomas Fitzsimmons
2023-08-15 22:46           ` Mauro Aranda
2023-08-16 15:16             ` Thomas Fitzsimmons
2023-08-19  8:34             ` Eli Zaretskii
2023-08-21 12:23 ` Mattias Engdegård
2023-08-21 14:43   ` Mauro Aranda
2023-08-21 15:24     ` Mattias Engdegård

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