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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19013 in the body.
You can then email your comments to 19013 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Mon, 10 Nov 2014 21:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Magne Ingebrigtsen <larsi <at> gnus.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Nov 2014 21:52:02 GMT) Full text and rfc822 format available.

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

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Suggestions for M-x commands
Date: Mon, 10 Nov 2014 22:51:03 +0100
I just typed `M-x eww RET foo RET', and after displaying the search
results, Emacs helpfully said

You can run the command `eww' with M-x ew RET

I don't think that's particularly helpful, actually.  Just distracting.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Tue, 11 Nov 2014 01:39:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Mon, 10 Nov 2014 20:38:08 -0500
> I just typed `M-x eww RET foo RET', and after displaying the search
> results, Emacs helpfully said
> You can run the command `eww' with M-x ew RET
> I don't think that's particularly helpful, actually.  Just distracting.

Maybe we should only display it if the shorthand is at least
2 chars shorter?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Tue, 11 Nov 2014 02:09:01 GMT) Full text and rfc822 format available.

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

From: Jay Belanger <jay.p.belanger <at> gmail.com>
To: 19013 <at> debbugs.gnu.org
Cc: jay.p.belanger <at> gmail.com
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Mon, 10 Nov 2014 20:08:48 -0600
>> You can run the command `eww' with M-x ew RET
>> I don't think that's particularly helpful, actually.  Just distracting.
>
> Maybe we should only display it if the shorthand is at least
> 2 chars shorter?

I would think that if I was just starting off with Emacs, then some of
the M-x shortcuts would look cryptic and would still be more distracting
than helpful, particularly if I didn't know that the shortcut was the
minimum needed to complete to the actual command name.
Also, I wonder if the minimum shortcut could change if a user had  more
packages loaded. 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Tue, 11 Nov 2014 02:47:01 GMT) Full text and rfc822 format available.

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

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Tue, 11 Nov 2014 03:45:48 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> I just typed `M-x eww RET foo RET', and after displaying the search
>> results, Emacs helpfully said
>> You can run the command `eww' with M-x ew RET
>> I don't think that's particularly helpful, actually.  Just distracting.
>
> Maybe we should only display it if the shorthand is at least
> 2 chars shorter?

Or...  10 chars shorter?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Tue, 11 Nov 2014 04:02:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jay Belanger <jay.p.belanger <at> gmail.com>
Cc: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Mon, 10 Nov 2014 23:01:13 -0500
> Also, I wonder if the minimum shortcut could change if a user had  more
> packages loaded. 

Of course, it can (not that some other even shorter one can appear, but
rather that this shortcut becomes insufficient).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Sun, 16 Nov 2014 19:40:02 GMT) Full text and rfc822 format available.

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

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Sun, 16 Nov 2014 20:39:20 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> I just typed `M-x eww RET foo RET', and after displaying the search
>> results, Emacs helpfully said
>> You can run the command `eww' with M-x ew RET
>> I don't think that's particularly helpful, actually.  Just distracting.
>
> Maybe we should only display it if the shorthand is at least
> 2 chars shorter?

I made it a five-char limit.  I don't think it makes sense to recommend
not-very-mnemonic commands to users if they aren't significantly
shorter.  And the shortcuts can change depending on what's loaded, so...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Sun, 16 Nov 2014 19:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Sun, 16 Nov 2014 20:41:05 +0100
By the way, there are things like

        (unless (or binding executing-kbd-macro (not (symbolp function))
                    (<= (length (symbol-name function)) 2))

in the code, and reading it, I don't understand the reason for the
`(not (symbolp function))' bit.  It seems like something should have
bugged out a lot earlier if `function' isn't a symbol?  Am I misreading
the code?

(Not to mention that `(unless (or ...))' is...  Doubleplusungood.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Added tag(s) fixed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 16 Nov 2014 19:42:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 19013 <at> debbugs.gnu.org and Lars Magne Ingebrigtsen <larsi <at> gnus.org> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 16 Nov 2014 19:42:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Wed, 19 Nov 2014 07:16:02 GMT) Full text and rfc822 format available.

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

From: Ivan Shmakov <ivan <at> siamics.net>
To: 19013 <at> debbugs.gnu.org
Subject: Re: bug#19013: 25.0.50; Suggestions for M-x commands 
Date: Wed, 19 Nov 2014 07:14:52 +0000
[Message part 1 (text/plain, inline)]
>>>>> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

 > I just typed `M-x eww RET foo RET', and after displaying the search
 > results, Emacs helpfully said

 > You can run the command `eww' with M-x ew RET

 > I don't think that's particularly helpful, actually.  Just
 > distracting.

	And even more so, – 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.)

-- 
FSF associate member #7257  np. Epilogue (Relief) — Apocalyptica    … 230E 334A
[Message part 2 (text/diff, inline)]
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1680,7 +1680,7 @@ 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 t 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.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Sun, 23 Nov 2014 11:52:02 GMT) Full text and rfc822 format available.

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.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Mon, 24 Nov 2014 04:12:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: 19152-submitter <at> debbugs.gnu.org, 19013 <at> debbugs.gnu.org,
 19152 <at> debbugs.gnu.org
Subject: Re: bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
Date: Sun, 23 Nov 2014 23:11:22 -0500
>> 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.

Sounds like a plain bug.

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

I don't think that's needed.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19013; Package emacs. (Mon, 24 Nov 2014 07:03:02 GMT) Full text and rfc822 format available.

Message #39 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
Subject: Re: bug#19152: 25.0.50; Suggestions for M-x commands 
Date: Mon, 24 Nov 2014 07:01:56 +0000
>>>>> Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

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

 > Sounds like a plain bug.

	One more reason for the new features to provide a way for the
	user to opt out, – just in case they turn to be buggy.

	Frankly, I do not consider this feature helpful, and have no
	intent on fixing this particular issue in its implementation.

	If anything, I’d just live with the workaround I’ve provided
	earlier [1].

[1] http://debbugs.gnu.org/19013#msg30

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

 > I don't think that's needed.

	The mere fact that bug#19152 was filed suggests otherwise.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 Dec 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 134 days ago.

Previous Next


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