From: Lars Magne Ingebrigtsen Date: Sun, 16 Nov 2014 19:37:51 +0000 (+0100) Subject: Only show the "You can run" message if it's significantly shorter X-Git-Tag: emacs-25.0.90~2635^2~449 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=716492429686736f14e3d4f6285116b46b437ec9;p=emacs.git 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). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9d22d7609e2..e2ca2284ef4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-11-16 Lars Magne Ingebrigtsen + + * 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 * calendar/icalendar.el (icalendar--convert-tz-offset): Return diff --git a/lisp/simple.el b/lisp/simple.el index 203ea514e15..9665cd53d3f 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