Subject: Re: bug#59539: 29.0.50; Commands created with `insert-kbd-macro` are NOT getting repeated.

From: Juri Linkov <[email-masked]>
Date: Thu, 15 Dec 2022 09:20:31 +0200

> Ramesh> (defalias 'my-cmd-a
> Ramesh>   (kmacro "C-f C-f"))
>
> Ramesh> (defalias 'my-cmd-b
> Ramesh>   (kmacro "C-b C-b"))
>
> Ramesh> (define-key my-kmacro-keymap (kbd "a") #'my-cmd-a)
> Ramesh> (define-key my-kmacro-keymap (kbd "b") #'my-cmd-b)
>
> Hmm, with your recipe on emacs master, "<f12> b" repeats, but "<f12>
> a" doesnʼt. I have no clue why, they call the same underlying
> infrastructure.

Sorry, I missed this bug report.  This is because 'repeat-check-key'
is t by default so that unrelated key sequences, for example, 'C-_'
should not activate the repeat map for 'undo', only 'C-x u' should.

When the user types 'a', the real key from kmacro is 'C-f'.
There is no 'f' in the keymap above, so it's ignored,
when 'repeat-check-key' is not customized to nil.

Do you have an idea how to do the right thing and to guess the user's
intention without checking if there are the same keys in the keymap?