emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] [emacs] 01/01: Only show the "You can run" message if it's


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] [emacs] 01/01: Only show the "You can run" message if it's significantly shorter
Date: Sun, 16 Nov 2014 19:37:58 +0000

larsi pushed a commit to branch master
in repository emacs.

commit 716492429686736f14e3d4f6285116b46b437ec9
Author: Lars Magne Ingebrigtsen <address@hidden>
Date:   Sun Nov 16 20:37:51 2014 +0100

    Only show the "You can run" message if it's significantly shorter
    
    * simple.el (execute-extended-command): Don't show the help
    message if the binding isn't significantly shorter than the
    M-x command the user typed (bug#19013).
---
 lisp/ChangeLog |    6 ++++++
 lisp/simple.el |    8 +++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9d22d76..e2ca228 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-16  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * simple.el (execute-extended-command): Don't show the help
+       message if the binding isn't significantly shorter than the
+       M-x command the user typed (bug#19013).
+
 2014-11-16  Ulf Jasper  <address@hidden>
 
        * calendar/icalendar.el (icalendar--convert-tz-offset): Return
diff --git a/lisp/simple.el b/lisp/simple.el
index 203ea51..9665cd5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1686,7 +1686,13 @@ invoking, give a prefix argument to 
`execute-extended-command'."
           (while-no-input
             (setq binding (execute-extended-command--shorter
                            (symbol-name function) typed))))
-        (when binding
+        (when (and binding
+                  (or (not (stringp binding))
+                      (> (- (length (symbol-name function)) (length binding))
+                         ;; Don't show the help message if the
+                         ;; binding isn't significantly shorter than
+                         ;; the M-x command the user typed.
+                         5)))
           (with-temp-message
               (format "You can run the command `%s' with %s"
                       function



reply via email to

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