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

From: Juri Linkov <[email-masked]>
Date: Tue, 14 Jan 2025 21:42:13 +0200

> If we now do forward-list followed by two repeat-map yanks (i.e., C-M-n
> y y), then we wind up in repeat-paragraph-map (but we should have never
> left repeat-list-map).

Thanks for the clear test case.  So the essential part is that
the key is repeated twice: "y y".  This was missing in the tests,
so I replaced "C-M-o" with "C-M-o C-M-o" in repeat-tests.el.

> Here the precise value of the repeat-map property of yank should not
> affect behavior (and so that property should not exist), but it does,
> due to the way repeat-post-hook is currently coded.  What happens is
> that when we are continuing a repeat map via repeat-continue, the value
> of map-sym is discarded in the evaluation of
>
>   (repeat-get-map map-sym)
>
> but gets used later in
>
>   (setq repeat-in-progress map-sym)
>
> In such cases, we should instead (somehow) first modify map-sym so that
> it is the symbol describing the "continue" map whose value is ultimately
> returned via (repeat-get-map map-sym).  I'm not sure how best to do so.

I was trying to keep the existing function signature for 'repeat-get-map'
that was without arguments.  But maybe it's fine to add a new required
argument.  Then refactoring was straightforward, and now even modified
tests passed.  Please try it out.