emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6f86ec8 7/9: Add a variable to control "shorter com


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 6f86ec8 7/9: Add a variable to control "shorter command" suggestions
Date: Sat, 30 Apr 2016 15:31:18 +0000

branch: master
commit 6f86ec8050c12b131b5a8d54a42fef04445f9482
Author: Ivan Shmakov <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Add a variable to control "shorter command" suggestions
    
    * lisp/simple.el (extended-command-suggest-shorter): New variable 
(bug#19152).
    (execute-extended-command): Use it.
---
 lisp/simple.el |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 849cbd6..fca7396 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1634,6 +1634,11 @@ If the value is non-nil and not a number, we wait 2 
seconds."
                  (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 ""))
@@ -1716,7 +1721,8 @@ invoking, give a prefix argument to 
`execute-extended-command'."
                         ((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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]