GNU bug report logs -
#43593
27.1; `customize-set-variable': wrong prompt for Boolean value
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Thu, 24 Sep 2020 17:13:02 UTC
Severity: wishlist
Found in version 27.1
Fixed in version 28.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 43593 in the body.
You can then email your comments to 43593 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43593
; Package
emacs
.
(Thu, 24 Sep 2020 17:13: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
.
(Thu, 24 Sep 2020 17:13:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This bug exists since at least Emacs 22.
emacs -Q
(defcustom bar nil
"@@@"
:type 'boolean :group 'convenience)
M-x customize-set-variable bar
Set variable: bar
The prompt for the Boolean value is this:
[boolean] Set customized value for bar to: (y or n)
Set it to WHAT?
It turns out that `y' sets the value to `t' and `n' sets the value to
`nil'. But there's no way of knowing that.
The fault is with function `custom-prompt-variable', or more precisely,
with `widget-prompt-value', and then with `widget-boolean-prompt-value'.
It's the latter that calls `y-or-n-p'.
The value returned by `y-or-n-p' is t or nil, which is OK. But the
prompt and the expected inputs are wrong.
Even if the prompt said "[boolean] Set customized value for bar to `t':
(y or n)" it would be inadequate, because it suggests that if you reply
`n' then the variable value remains unchanged. `y-or-n-p' is just wrong
here.
The comment for `widget-boolean-prompt-value' says that it toggles. But
it does NOT toggle. And `customize-set-variable' should NOT just toggle
the current value anyway. It should always prompt you for the new
value, which may or may not be already the current value. The command
needs to be consistent.
Maybe the `boolean' widget should be changed to use `widge-prompt-value,
not `widget-boolean-prompt-value' or something? That it inherits from
the `toggle' widget is fine - that's for the Toggle button in the
Customize UI. But `customize-set-variable' needs a better prompt
(better behavior).
In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
of 2020-08-12 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
System Description: Microsoft Windows 10 Pro (v10.0.1903.18362.1082)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43593
; Package
emacs
.
(Thu, 24 Sep 2020 17:27:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 43593 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 24 Sep 2020 10:09:57 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
>
> emacs -Q
>
> (defcustom bar nil
> "@@@"
> :type 'boolean :group 'convenience)
>
> M-x customize-set-variable bar
> Set variable: bar
>
> The prompt for the Boolean value is this:
>
> [boolean] Set customized value for bar to: (y or n)
>
> Set it to WHAT?
To 'y' or to 'n'.
FWIW, I see no problem here, and would understand immediately what is
meant. We do this kind of "translation" of boolean values a'll the
time in Customize. Let's keep in mind that Customize is for users
that aren't Lisp programmers, so we don't want to request them to know
what Lisp boolean data looks like.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43593
; Package
emacs
.
(Thu, 24 Sep 2020 18:15:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 43593 <at> debbugs.gnu.org (full text, mbox):
> FWIW, I see no problem here, and would understand immediately what is
> meant. We do this kind of "translation" of boolean values a'll the
> time in Customize. Let's keep in mind that Customize is for users
> that aren't Lisp programmers, so we don't want to request them to know
> what Lisp boolean data looks like.
I understand what you're saying. I don't agree that
it's clear now for a user.
If the prompt said something like this it would be
clearer:
Set customized value for bar to true (y) or false (n): (y or n)
It's wrong to suggest that this is about setting
the value to `y' or `n'.
And users are used to "(y or n)" being used primarily
(almost exclusively) for confirming something.
I think the (ab)use of the `y-or-n-p' UI is unhelpful
here (misleading, unclear).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43593
; Package
emacs
.
(Sun, 06 Jun 2021 11:24:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 43593 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> If the prompt said something like this it would be
> clearer:
>
> Set customized value for bar to true (y) or false (n): (y or n)
>
> It's wrong to suggest that this is about setting
> the value to `y' or `n'.
Yes, I agree that it's kinda obscure. The proposed prompt here is a bit
long though, so I've gone with this instead in Emacs 28:
"Set customized value for bar to true: (y or n)"
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 28.1, send any further explanations to
43593 <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
.
(Sun, 06 Jun 2021 11:24:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43593
; Package
emacs
.
(Sun, 06 Jun 2021 15:19:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 43593 <at> debbugs.gnu.org (full text, mbox):
> > Set customized value for bar to true (y) or false (n): (y or n)
>
> Yes, I agree that it's kinda obscure. The proposed prompt here is a bit
> long though, so I've gone with this instead in Emacs 28:
>
> "Set customized value for bar to true: (y or n)"
Yes, that's fine. Thx.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 05 Jul 2021 11:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.