From 8c252e2326a3f633d281d70d2f9e7e75975ebdab Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 6 Jun 2022 16:43:12 +0200 Subject: [PATCH] Fix execute-extended-command help text for remapped commands * lisp/simple.el (execute-extended-command): Don't provide misleading help text for remapped commands (bug#23543). --- lisp/simple.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index ac41b394a78..f6932339c99 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2450,6 +2450,11 @@ invoking, give a prefix argument to `execute-extended-command'." (find-shorter nil)) (unless (commandp function) (error "`%s' is not a valid command name" command-name)) + ;; If we're executing a command that's remapped, we can't actually + ;; execute that command with the keymapping we've found with + ;; `where-is-internal'. + (when (and binding (command-remapping function)) + (setq binding nil)) ;; Some features, such as novice.el, rely on this-command-keys ;; including M-x COMMAND-NAME RET. (set--this-command-keys (concat "\M-x" (symbol-name function) "\r")) -- 2.39.2