From: Juri Linkov <juri@linkov.net>
To: JD Smith <jdtsmith@gmail.com>
Cc: 70576@debbugs.gnu.org
Subject: bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints"
Date: Sun, 28 Apr 2024 09:58:10 +0300 [thread overview]
Message-ID: <86cyqaezhc.fsf@mail.linkov.net> (raw)
In-Reply-To: <FDB853F1-60B6-4ACF-8E08-337567CB3CBC@gmail.com> (JD Smith's message of "Fri, 26 Apr 2024 10:37:51 -0400")
>> (defvar-keymap expreg-repeat-map
>> :doc "Repeat map for `expreg' actions."
>> :repeat t
>> "\\" 'expreg-expand
>> "|" 'expreg-contract)
>>
>> (put 'expreg-expand 'repeat-hint "expand")
>> (put 'expreg-contract 'repeat-hint "contract")
>
> Thanks for taking a look. A property on the command could work (and then
> you need no :name). It would be somewhat harder to maintain the structure
> for long keymaps, e.g. if a command changes. I do note that menu-item with
> :filter is commonly recommended for non-menu dynamic bindings, so there is
> some precedent of reusing menu functionality in other contexts.
As a more complicated feature, usually :filter is added by developers for
specific functionality, it's not intended to be used by users in their normal
customization of keymaps, like users will configure hints.
> Of course a new wrapper macro could also be developed to ease this.
> Do you anticipate any specific issues?
Here is what I recommend to do to simplify the definition of hints for users.
Like there can be a list of enter and exit commands in 'defvar-keymap':
:repeat ‘(:enter (commands ...) :exit (commands ...))’
the same list could be used for hints:
:repeat ‘(:enter (commands ...) :exit (commands ...) :hints ((command . hint) ...))’
This should be easier to document and to understand by users than
a special syntax of cons for binding and the requirement to add :name.
next prev parent reply other threads:[~2024-04-28 6:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 22:31 bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints" JD Smith
2024-04-26 6:06 ` Juri Linkov
2024-04-26 14:37 ` JD Smith
2024-04-28 6:58 ` Juri Linkov [this message]
2024-04-28 12:45 ` JD Smith
2024-04-28 16:38 ` Juri Linkov
2024-05-02 6:48 ` Juri Linkov
2024-05-02 7:16 ` Eli Zaretskii
2024-05-02 11:47 ` JD Smith
2024-05-02 16:16 ` Juri Linkov
2024-05-02 18:14 ` Eli Zaretskii
2024-05-03 6:23 ` Juri Linkov
2024-05-03 7:15 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86cyqaezhc.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=70576@debbugs.gnu.org \
--cc=jdtsmith@gmail.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 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.