From: Lars Ingebrigtsen Date: Mon, 6 Jun 2022 14:43:12 +0000 (+0200) Subject: Fix execute-extended-command help text for remapped commands X-Git-Tag: emacs-29.0.90~1910^2~188 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c252e2326a3f633d281d70d2f9e7e75975ebdab;p=emacs.git 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). --- 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"))