* master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
@ 2021-12-26 16:32 Eli Zaretskii
2021-12-26 17:09 ` Stefan Kangas
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-12-26 16:32 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> branch: master
> commit 40dcf9c2abd62425e599f30548dc53fa58fe2202
> Author: Stefan Kangas <stefan@marxist.se>
> Commit: Stefan Kangas <stefan@marxist.se>
>
> read-multiple-choice: Display "SPC" instead of " "
>
> * lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve display
> of the keys TAB, RET, SPC, DEL, and ESC. This fixes a bug where " "
> was highlighted in the description in a confusing way.
> * test/lisp/emacs-lisp/rmc-tests.el
> (test-rmc--add-key-description)
> (test-rmc--add-key-description/with-attributes): Update tests for the
> above change.
I don't think I like the result of this changeset. Now SPC is
displayed as [SPC], in brackets, for a reason I cannot understand.
Those brackets get in the way, especially if the Help buffer is
already shown, because there the keys are shown as they should be:
without any brackets.
This affects novice.el, which is for newbies, and so the instructions
cannot be confusing.
Why is it a good idea to show some of the responses in brackets? I
say let's remove the brackets altogether, they are not needed,
especially since the keys are already in a special face. Too many
features at once are not necessarily a Good Thing.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-26 16:32 master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " " Eli Zaretskii
@ 2021-12-26 17:09 ` Stefan Kangas
2021-12-26 18:23 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2021-12-26 17:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> I don't think I like the result of this changeset. Now SPC is
> displayed as [SPC], in brackets, for a reason I cannot understand.
Before this change, SPC in `read-multiple-choice' was displayed as, for
example
yes; use once
^
Where the indicated space character was underlined. So this is
much less confusing, I think. (See below regarding the brackets.)
Though when moving `disabled-command' to use `read-multiple-choice' it
is true that we did lose the explanation in the old prompt that said:
Type y, n, ! or SPC (the space bar):
I'm not sure what, if anything we should do about this. One idea is to
explain what SPC means at the bottom of the *Disabled Command* buffer.
(Personally, I think by the time you stumble upon `disabled-command' you
should already be proficient enough to know what SPC means. But I have
nothing against being defensive.)
> Those brackets get in the way, especially if the Help buffer is
> already shown, because there the keys are shown as they should be:
> without any brackets.
>
> This affects novice.el, which is for newbies, and so the instructions
> cannot be confusing.
>
> Why is it a good idea to show some of the responses in brackets? I
> say let's remove the brackets altogether, they are not needed,
> especially since the keys are already in a special face. Too many
> features at once are not necessarily a Good Thing.
I think you have a point regarding these brackets, but note that they
have always been there with `read-multiple-choice'.
We could remove them, I think, but would they still be needed on
terminals that can't display underline? Or should we perhaps just use
help-key-binding in that case?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-26 17:09 ` Stefan Kangas
@ 2021-12-26 18:23 ` Eli Zaretskii
2021-12-26 20:41 ` Stefan Kangas
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-12-26 18:23 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Sun, 26 Dec 2021 09:09:15 -0800
> Cc: emacs-devel@gnu.org
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > I don't think I like the result of this changeset. Now SPC is
> > displayed as [SPC], in brackets, for a reason I cannot understand.
>
> Before this change, SPC in `read-multiple-choice' was displayed as, for
> example
>
> yes; use once
> ^
>
> Where the indicated space character was underlined. So this is
> much less confusing, I think. (See below regarding the brackets.)
I;m not against using "SPC", I only don't like the brackets around it
(and around "!" as well). They distract and confuse, IMO.
> Though when moving `disabled-command' to use `read-multiple-choice' it
> is true that we did lose the explanation in the old prompt that said:
>
> Type y, n, ! or SPC (the space bar):
>
> I'm not sure what, if anything we should do about this. One idea is to
> explain what SPC means at the bottom of the *Disabled Command* buffer.
Why not allow read-multiple-choice to specify longer strings? It
already does, with "yes" and "no", doesn't it?
> (Personally, I think by the time you stumble upon `disabled-command' you
> should already be proficient enough to know what SPC means.
No, we need to support the case where the user type "C-n n" by
mistake.
> > Why is it a good idea to show some of the responses in brackets? I
> > say let's remove the brackets altogether, they are not needed,
> > especially since the keys are already in a special face. Too many
> > features at once are not necessarily a Good Thing.
>
> I think you have a point regarding these brackets, but note that they
> have always been there with `read-multiple-choice'.
>
> We could remove them, I think, but would they still be needed on
> terminals that can't display underline? Or should we perhaps just use
> help-key-binding in that case?
I think having the keys/responses in a special face, even if it's
without the underline, should be enough. The face should provide
alternatives for the underline, such as distinct colors.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-26 18:23 ` Eli Zaretskii
@ 2021-12-26 20:41 ` Stefan Kangas
2021-12-27 4:47 ` Yuri Khan
2021-12-27 17:56 ` Eli Zaretskii
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2021-12-26 20:41 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
> Why not allow read-multiple-choice to specify longer strings? It
> already does, with "yes" and "no", doesn't it?
Yup, so I added "(the space bar)".
> I think having the keys/responses in a special face, even if it's
> without the underline, should be enough. The face should provide
> alternatives for the underline, such as distinct colors.
I think you're right about the brackets. See the attached patch, WDYT?
[-- Attachment #2: rmc-prompt.diff --]
[-- Type: text/x-diff, Size: 1365 bytes --]
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el
index 522d395eba..9d5fe40f9a 100644
--- a/lisp/emacs-lisp/rmc.el
+++ b/lisp/emacs-lisp/rmc.el
@@ -38,10 +38,10 @@ rmc--add-key-description
;; Not in the name string, or a special character.
((or (not pos)
(member desc '("ESC" "TAB" "RET" "DEL" "SPC")))
- (format "[%s] %s"
+ (format "%s %s"
(if graphical-terminal
(propertize desc 'face 'read-multiple-choice-face)
- desc)
+ (propertize desc 'face 'help-key-name))
name))
;; The prompt character is in the name, so highlight
;; it on graphical terminals.
diff --git a/lisp/novice.el b/lisp/novice.el
index 0cf54df160..d48b1109d0 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -88,7 +88,7 @@ disabled-command-function
'((?y "yes")
(?n "no")
(?! "yes; enable for session")
- (?\s "yes; once"))
+ (?\s "(the space bar) yes; once"))
help-string
"*Disabled Command*"))))
(pcase char
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-26 20:41 ` Stefan Kangas
@ 2021-12-27 4:47 ` Yuri Khan
2021-12-27 5:44 ` Stefan Kangas
2021-12-27 17:56 ` Eli Zaretskii
1 sibling, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2021-12-27 4:47 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-tangents
On Mon, 27 Dec 2021 at 03:42, Stefan Kangas <stefan@marxist.se> wrote:
> Yup, so I added "(the space bar)".
By the way, must you call it *the* space *bar*?
You’re probably assuming the currently dominant keyboard design where
there is a single space key that is somewhere between 5 and 8 units
long, but this is not the only possible and not the most efficient
design, which gives both thumbs a single function — to separate words.
Many keyboard enthusiasts today build keyboards that utilize thumbs
more efficiently, placing 3 to 8 keys in an arc or a cluster under
each thumb. An Emacs user especially benefits from such a layout
because all modifiers can be made so much more accessible. For these
designs, space keys are normal-sized (1, 1.25, sometimes 1.5u), and
there might be two of them so it might not be technically correct to
talk about “the” space key.
I therefore propose “(space key)”.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-27 4:47 ` Yuri Khan
@ 2021-12-27 5:44 ` Stefan Kangas
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2021-12-27 5:44 UTC (permalink / raw)
To: Yuri Khan; +Cc: emacs-tangents
Yuri Khan <yuri.v.khan@gmail.com> writes:
> By the way, must you call it *the* space *bar*?
>
> You’re probably assuming the currently dominant keyboard design
No, I just copied the text from what we had before.
> Many keyboard enthusiasts today build keyboards that utilize thumbs
> more efficiently,
Sure, I have a Kinesis Advantage 2 myself.
> I therefore propose “(space key)”.
I'm fine with "(space key)", but I don't really have an opinion.
Personally, I find the text redundant.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-26 20:41 ` Stefan Kangas
2021-12-27 4:47 ` Yuri Khan
@ 2021-12-27 17:56 ` Eli Zaretskii
2021-12-27 19:50 ` Stefan Kangas
1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-12-27 17:56 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Sun, 26 Dec 2021 12:41:34 -0800
> Cc: emacs-devel@gnu.org
>
> > I think having the keys/responses in a special face, even if it's
> > without the underline, should be enough. The face should provide
> > alternatives for the underline, such as distinct colors.
>
> I think you're right about the brackets. See the attached patch, WDYT?
Sounds OK, module the "the" part in "the space bar".
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " "
2021-12-27 17:56 ` Eli Zaretskii
@ 2021-12-27 19:50 ` Stefan Kangas
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2021-12-27 19:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Sounds OK, module the "the" part in "the space bar".
Thanks, pushed to master with that change.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-27 19:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-26 16:32 master 40dcf9c2ab 4/5: read-multiple-choice: Display "SPC" instead of " " Eli Zaretskii
2021-12-26 17:09 ` Stefan Kangas
2021-12-26 18:23 ` Eli Zaretskii
2021-12-26 20:41 ` Stefan Kangas
2021-12-27 4:47 ` Yuri Khan
2021-12-27 5:44 ` Stefan Kangas
2021-12-27 17:56 ` Eli Zaretskii
2021-12-27 19:50 ` Stefan Kangas
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.