unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Juri Linkov <juri@linkov.net>, Eshel Yaron <me@eshelyaron.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: master 0023891e842: Support hints in the :repeat keyword of defvar-keymap for repeat-mode
Date: Tue, 7 May 2024 07:56:15 -0400	[thread overview]
Message-ID: <AAF4CF79-238D-499A-ADB4-5760AAA5229F@gmail.com> (raw)
In-Reply-To: <86cypyi1b3.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]



> On May 7, 2024, at 2:27 AM, Juri Linkov <juri@linkov.net> wrote:
> 
>> The need to repeat the name of the command in order to specify its label
>> ("hint") makes the keymap definition twice as long and prone to errors.
>> For example, after adding "hints" to one of my keymaps I got:
>> [...]
>> I don't have a great idea for an alternative interface off the top of my
>> head, but if there's a way to avoid this duplication I think it would be
>> a significant improvement.

The original patch <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70576> re-used the (STRING . DEFN) menu form of key bindings to avoid such duplication, but was deemed too confusing for users.

> Unfortunately, duplication can be removed only at the cost of
> complicating the definitions of bindings that would be more
> hard to learn for users, and therefore will remain prone to errors.
> 
>> Lastly, it could be nice to make the appearance of the prompt more in
>> line with the read-multiple-choice prompt, which is conceptually very
>> similar.  Crucially, if the key is a character that occurs in the label,
>> it's better, IMO, to highlight the first occurrence of that character in
>> the label (as r-m-c does) than to prefix the label with that character.
>> We can reuse rmc--add-key-description for that purpose, as follows:
> 
> Nice idea.  A small problem is that when hints are not used,
> it inserts an extra space between the character and comma.
> But this is so minor that you could push the patch
> if you think it's not worth making code more complex
> by using rmc only when hints are specified.

That will save some space.  Remember though that many times the key will not appear in the hint. In that case it would be nice to have a connector character of some kind, e.g. `|':expreg.


[-- Attachment #2: Type: text/html, Size: 2379 bytes --]

  reply	other threads:[~2024-05-07 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171463246897.31562.10434330482523385662@vcs2.savannah.gnu.org>
     [not found] ` <20240502064749.54E89C1F9D4@vcs2.savannah.gnu.org>
2024-05-06 21:27   ` master 0023891e842: Support hints in the :repeat keyword of defvar-keymap for repeat-mode Eshel Yaron
2024-05-07  6:27     ` Juri Linkov
2024-05-07 11:56       ` JD Smith [this message]
2024-05-07 17:13         ` Eshel Yaron
2024-05-07 17:20           ` Juri Linkov
2024-05-08 16:40             ` Eshel Yaron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AAF4CF79-238D-499A-ADB4-5760AAA5229F@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).