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

From: Paul Nelson <[email-masked]>
Date: Tue, 5 Nov 2024 21:51:11 +0100

> I see now that the previous idea
> was insufficient since it lacks a map.  So a better way is to define
> a combination of a repeat-map and a key:
>
>   (put 'undo 'repeat-continue-keys '((paragraph-repeat-map . "C-/")))
>
> > I guess one alias-free approach would be to introduce a
> > repeat-continue property describing keymaps that a command should
> > perpetuate, e.g.,
> >
> >   (put 'yank 'repeat-continue '(paragraph-repeat-map))
> >   (put 'undo 'repeat-continue '(paragraph-repeat-map))
>
> 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.

> 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?