]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix execute-extended-command help text for remapped commands
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 6 Jun 2022 14:43:12 +0000 (16:43 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 6 Jun 2022 14:43:12 +0000 (16:43 +0200)
* lisp/simple.el (execute-extended-command): Don't provide
misleading help text for remapped commands (bug#23543).

lisp/simple.el

index ac41b394a78d9036f1c77eed86850b8dcc9037c9..f6932339c9986bdc1f308f65a335c99715ebe86a 100644 (file)
@@ -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"))