unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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 17:56       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ 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] 6+ 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 17:56       ` Eli Zaretskii
  2021-12-27 19:50         ` Stefan Kangas
  0 siblings, 1 reply; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread

end of thread, other threads:[~2021-12-27 19:50 UTC | newest]

Thread overview: 6+ 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 17:56       ` Eli Zaretskii
2021-12-27 19:50         ` Stefan Kangas

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