unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 19013@debbugs.gnu.org, 19152@debbugs.gnu.org,
	19152-submitter@debbugs.gnu.org
Subject: bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Sun, 23 Nov 2014 11:50:45 +0000	[thread overview]
Message-ID: <87lhn2uodm.fsf@violet.siamics.net> (raw)
In-Reply-To: <87y4r77jbn.fsf@violet.siamics.net> (Ivan Shmakov's message of "Wed, 19 Nov 2014 07:14:52 +0000")

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

>>>>> Ivan Shmakov <ivan@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 1757 bytes --]

--- 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.

  reply	other threads:[~2014-11-23 11:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 21:51 bug#19013: 25.0.50; Suggestions for M-x commands Lars Magne Ingebrigtsen
2014-11-11  1:38 ` Stefan Monnier
2014-11-11  2:08   ` Jay Belanger
2014-11-11  4:01     ` Stefan Monnier
2014-11-11  2:45   ` Lars Magne Ingebrigtsen
2014-11-16 19:39   ` Lars Magne Ingebrigtsen
2014-11-16 19:41   ` Lars Magne Ingebrigtsen
2014-11-19  7:14 ` Ivan Shmakov
2014-11-23 11:50   ` Ivan Shmakov [this message]
2014-11-24  4:11     ` bug#19152: " Stefan Monnier
2014-11-24  7:01       ` bug#19013: bug#19152: " Ivan Shmakov
2014-11-24 14:57         ` bug#19152: " Stefan Monnier
2014-11-25  9:09           ` Ivan Shmakov
2014-11-25 14:50             ` Stefan Monnier
2014-11-25 15:45               ` Ivan Shmakov
2014-11-25 16:51                 ` Eli Zaretskii
2014-11-25 18:10                   ` Ivan Shmakov
2014-11-26  2:22                     ` Stefan Monnier
2016-04-30 15:22                   ` Lars Ingebrigtsen
2014-11-25 17:38                 ` Stefan Monnier
2014-11-24 13:12       ` bug#19152: bug#19013: bug#19152: bug#19013: " Eli Zaretskii
2014-11-28 23:15       ` Stefan Monnier
2014-12-02 10:14         ` bug#19152: " Ivan Shmakov
2014-12-02 13:57           ` Stefan Monnier
2016-03-09 11:37             ` Brendan O'Dea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhn2uodm.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=19013@debbugs.gnu.org \
    --cc=19152-submitter@debbugs.gnu.org \
    --cc=19152@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).