--- a/lisp/simple.el 2014-11-21 09:21:50 +0000 +++ b/lisp/simple.el @@ -1598,6 +1598,11 @@ (integer :tag "time" 2) (other :tag "on"))) +(defcustom extended-command-suggest-shorter t + "Non-nil means show a shorter M-x invocation when there is one." + :group 'keyboard + :type 'boolean) + (defun execute-extended-command--shorter-1 (name length) (cond ((zerop length) (list "")) @@ -1680,7 +1685,8 @@ defun execute-extended-command (prefixarg &optional command-name typed) ((numberp suggest-key-bindings) suggest-key-bindings) (t 2))))) (when (and waited (not (consp unread-command-events))) - (unless (or binding executing-kbd-macro (not (symbolp function)) + (unless (or (not extended-command-suggest-shorter) + binding executing-kbd-macro (not (symbolp function)) (<= (length (symbol-name function)) 2)) ;; There's no binding for CMD. Let's try and find the shortest ;; string to use in M-x.