[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "
From: |
Juri Linkov |
Subject: |
bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints" |
Date: |
Sun, 28 Apr 2024 09:58:10 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
>> (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.