From 716492429686736f14e3d4f6285116b46b437ec9 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 16 Nov 2014 20:37:51 +0100 Subject: [PATCH] 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 deletion(-) 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 -- 2.39.5