Subject: Re: bug#29399: 26.0.90; `edit-kbd-macro' has bad prompt

From: Noam Postavsky <[email-masked]>
Date: Wed, 22 Nov 2017 19:13:38 -0500

Drew Adams <[email-masked]> writes:

> emacs -Q
>
> C-x ( C-f C-f C-f C-x )
>
> M-: (global-set-key (kbd "C-o") 'execute-extended-command)
> M-: (global-set-key (kbd "M-x") 'forward-char)
>
> C-o edit-kbd-macro RET
>
> The prompt says:
>
> "Keyboard macro to edit (C-x e, M-x, C-h l, or keys):"
>
> It should use \\[execute-extended-command] and thus say:
>
> "Keyboard macro to edit (C-x e, C-o, C-h l, or keys):"
>
> This prompt is anyway not clear.  The command should instead accept
> a key sequence that shows more complete info/help, and the prompt should
> just mention that key sequence.

I'm not sure if this would help so much for the OP's case [1], which is
more like:

    (defun my/execute-extended-command () ; actually `smex'[2] in OP's case
      (interactive)
      (call-interactively 'execute-extended-command))
    (global-set-key (kbd "M-x") 'my/execute-extended-command)

With that kind of config, I get

    Keyboard macro to edit (C-x e, <execute>, C-h l, or keys):

I have no idea how to produce <execute> on my keyboard.  If also do

    (define-key global-map [execute] 'ignore)

I get

    Keyboard macro to edit (C-x e, <menu>, C-h l, or keys):

which I know is the "Menu key" [3].  But personally, I disable the <menu>
key also, because otherwise I sometimes accidentally lean on it,
producing deeply nested minibuffer prompt which is annoying.

    (define-key global-map [menu] 'ignore)

Which ends up with this:

    "Keyboard macro to edit (C-x e, M-x execute-extended-command, C-h l, or keys):"

[1]: https://emacs.stackexchange.com/questions/37017/unable-to-supply-macro-name-to-edit-kbd-macro-when-m-x-is-bound-to-smex
[2]: https://github.com/nonsequitur/smex
[3]: https://en.wikipedia.org/wiki/Menu_key