GNU bug report logs - #19013
25.0.50; Suggestions for M-x commands

Previous Next

Package: emacs;

Reported by: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Date: Mon, 10 Nov 2014 21:52:01 UTC

Severity: minor

Tags: fixed

Found in version 25.0.50

Fixed in version 25.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #33 received at 19013 <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: 19013 <at> debbugs.gnu.org,
 19152 <at> debbugs.gnu.org, 19152-submitter <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands 
Date: Sun, 23 Nov 2014 11:50:45 +0000
[Message part 1 (text/plain, inline)]
>>>>> Ivan Shmakov <ivan <at> siamics.net> writes:

	(BTW, what about merging #19013 and #19152?)

[…]

 > M-x beginning-of-visual-line RET; then, after some time, – M-x <up>
 > RET – the same message gets shown, even though M-x <up> is for sure
 > shorter than M-x b-v.

 > I believe there should be a variable to customize this behavior
 > (say, suggest-shorter-command-limit; defaulting to 5, but with nil as
 > an option to disable such suggestions altogether.)  As a workaround,
 > I’ve simply disabled it entirely (see the patch MIMEd.)

	Please consider the patch MIMEd.

	* lisp/simple.el
	(suggest-shorter-command-limit): New customizable variable.
	(execute-extended-command--shorter): Respect
	`suggest-shorter-command-limit'.
	(execute-extended-command): Likewise.

-- 
FSF associate member #7257  np. Your Leaving — Jami Sieber   … B6A0 230E 334A
[Message part 2 (text/diff, inline)]
--- a/lisp/simple.el	2014-11-21 09:21:50 +0000
+++ b/lisp/simple.el	2014-11-23 11:34:08 +0000
@@ -1598,6 +1598,13 @@
                  (integer :tag "time" 2)
                  (other :tag "on")))
 
+(defcustom suggest-shorter-command-limit 5
+  "Only suggest the equivalent M-x invocation when shorter by this amount.
+If the value is nil, do not suggest shorter M-x key-bindings at all."
+  :group 'keyboard
+  :type '(choice (const :tag "off" nil)
+                 (integer :tag "characters")))
+
 (defun execute-extended-command--shorter-1 (name length)
   (cond
    ((zerop length) (list ""))
@@ -1623,7 +1630,7 @@ defun execute-extended-command--shorter (name typed)
                                       name len)))
                   ;; Don't show the help message if the binding isn't
                   ;; significantly shorter than the M-x command the user typed.
-                  (< len (- max 5))))
+                  (< len (- max suggest-shorter-command-limit))))
       (let ((candidate (pop candidates)))
         (when (equal name
                        (car-safe (completion-try-completion
@@ -1680,7 +1687,8 @@ defun execute-extended-command (prefixarg &optional command-name typed)
                       ((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 suggest-shorter-command-limit)
+                    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.

This bug report was last modified 10 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.