]> git.eshelyaron.com Git - emacs.git/commitdiff
Only show the "You can run" message if it's significantly shorter
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 16 Nov 2014 19:37:51 +0000 (20:37 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 16 Nov 2014 19:37:51 +0000 (20:37 +0100)
* 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
lisp/simple.el

index 9d22d7609e228c005fb9331ea290801bcd563ad7..e2ca2284ef439339839551d57445ce4bc84cdc9a 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * 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  <ulf.jasper@web.de>
 
        * calendar/icalendar.el (icalendar--convert-tz-offset): Return
index 203ea514e15996a0574be6e727a068ee03a7cd50..9665cd53d3f88c7f22bf8af8ccd5f195b4987994 100644 (file)
@@ -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