Subject: Re: bug#74140: [PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package

From: Juri Linkov <[email-masked]>
Date: Thu, 07 Nov 2024 21:41:07 +0200

>> Keys are required as well to be able to decide whether
>> to activate the repeat-map.
>
> I still don't follow.  Couldn't we somehow keep track of the active
> repeat-map (or really, its underlying symbol) and check whether that
> lies in the provided list?  Why should it be necessary to keep track
> of the key that activated it?  In any event, we don't know in advance
> whether the specific key is the same or different across the keymaps
> that we do or do not want the command to participate in, so I don't
> see how knowing the key could be a useful differentiating factor.

Keys will help to avoid aliases.  In your example:

 :continue-only
 ;; These commands will be available during paragraph manipulation
 ;; but won't activate paragraph-repeat-map themselves
 ("y" . yank)
 ("C-/" . undo))

to be able to not activate repeat-map on executing the command 'yank'
with the global keybinding such as 'C-y', we can check
that last-command-event is 'y'.

Or do you think it would help to take into account the fact
that the current repeat-map is already activated?  But still
in this case I don't see how it's possible to avoid checking the key.

>> There are two possible ways to do this: opt-in and out-out.
>>
>> 1. opt-in defines all global keys that activate a repeat-map. e.g.:
>>
>>   (put 'undo 'repeat-entry-keys '((paragraph-repeat-map . "C-x u")))
>>
>> 2. out-out defines only keys from the repeat-map that should not activate it
>>    by a global key such as the global "u" ('self-insert-command')
>>    should not activate paragraph-repeat-map:
>>
>>   (put 'undo 'repeat-no-entry-keys '((paragraph-repeat-map . "u")))
>
> What do you have in mind if the user updates the binds in the keymaps?

After any updates the user needs to update symbol properties as well.