unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19013: 25.0.50; Suggestions for M-x commands
@ 2014-11-10 21:51 Lars Magne Ingebrigtsen
  2014-11-11  1:38 ` Stefan Monnier
  2014-11-19  7:14 ` Ivan Shmakov
  0 siblings, 2 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-10 21:51 UTC (permalink / raw)
  To: 19013


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






^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  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
                     ` (3 more replies)
  2014-11-19  7:14 ` Ivan Shmakov
  1 sibling, 4 replies; 25+ messages in thread
From: Stefan Monnier @ 2014-11-11  1:38 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 19013

> 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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  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
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: Jay Belanger @ 2014-11-11  2:08 UTC (permalink / raw)
  To: 19013


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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-11  1:38 ` Stefan Monnier
  2014-11-11  2:08   ` Jay Belanger
@ 2014-11-11  2:45   ` Lars Magne Ingebrigtsen
  2014-11-16 19:39   ` Lars Magne Ingebrigtsen
  2014-11-16 19:41   ` Lars Magne Ingebrigtsen
  3 siblings, 0 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-11  2:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19013

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-11  2:08   ` Jay Belanger
@ 2014-11-11  4:01     ` Stefan Monnier
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Monnier @ 2014-11-11  4:01 UTC (permalink / raw)
  To: Jay Belanger; +Cc: 19013

> 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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-11  1:38 ` Stefan Monnier
  2014-11-11  2:08   ` Jay Belanger
  2014-11-11  2:45   ` Lars Magne Ingebrigtsen
@ 2014-11-16 19:39   ` Lars Magne Ingebrigtsen
  2014-11-16 19:41   ` Lars Magne Ingebrigtsen
  3 siblings, 0 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-16 19:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19013

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-11  1:38 ` Stefan Monnier
                     ` (2 preceding siblings ...)
  2014-11-16 19:39   ` Lars Magne Ingebrigtsen
@ 2014-11-16 19:41   ` Lars Magne Ingebrigtsen
  3 siblings, 0 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-16 19:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19013

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






^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: 25.0.50; Suggestions for M-x commands
  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-19  7:14 ` Ivan Shmakov
  2014-11-23 11:50   ` bug#19152: " Ivan Shmakov
  1 sibling, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-19  7:14 UTC (permalink / raw)
  To: 19013

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

>>>>> Lars Magne Ingebrigtsen <larsi@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

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

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-19  7:14 ` Ivan Shmakov
@ 2014-11-23 11:50   ` Ivan Shmakov
  2014-11-24  4:11     ` Stefan Monnier
  0 siblings, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-23 11:50 UTC (permalink / raw)
  To: 19013, 19152, 19152-submitter

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-23 11:50   ` bug#19152: " Ivan Shmakov
@ 2014-11-24  4:11     ` Stefan Monnier
  2014-11-24  7:01       ` bug#19013: bug#19152: " Ivan Shmakov
                         ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Stefan Monnier @ 2014-11-24  4:11 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 19152-submitter, 19013, 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.

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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19013: bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-24  4:11     ` Stefan Monnier
@ 2014-11-24  7:01       ` Ivan Shmakov
  2014-11-24 14:57         ` bug#19152: " Stefan Monnier
  2014-11-24 13:12       ` bug#19152: bug#19013: bug#19152: bug#19013: " Eli Zaretskii
  2014-11-28 23:15       ` Stefan Monnier
  2 siblings, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-24  7:01 UTC (permalink / raw)
  To: 19013, 19152

>>>>> Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: bug#19013: bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-24  4:11     ` Stefan Monnier
  2014-11-24  7:01       ` bug#19013: bug#19152: " Ivan Shmakov
@ 2014-11-24 13:12       ` Eli Zaretskii
  2014-11-28 23:15       ` Stefan Monnier
  2 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2014-11-24 13:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19152, ivan

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Date: Sun, 23 Nov 2014 23:11:22 -0500
> Cc: 19152-submitter@debbugs.gnu.org, 19013@debbugs.gnu.org,
> 	19152@debbugs.gnu.org
> 
> >> 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.

I disagree.  This is new behavior different from previous one, and
it's clearly at least a little bit controversial.  So I think we
should have an option to turn it off and get back the old behavior.
Something like what Ivan proposed, with minor changes, would be good,
IMO.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: bug#19013: bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-24  7:01       ` bug#19013: bug#19152: " Ivan Shmakov
@ 2014-11-24 14:57         ` Stefan Monnier
  2014-11-25  9:09           ` Ivan Shmakov
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2014-11-24 14:57 UTC (permalink / raw)
  To: 19152

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

Options to circumvent bugs are a bad idea, in general (with exceptions,
of course, like everything, such as when the bug is particularly hard to
fix, or occurs in some code we can't control).

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

An option to turn the feature off is fine.  An option to choose the
number of chars we have to gain is not.


        Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-24 14:57         ` bug#19152: " Stefan Monnier
@ 2014-11-25  9:09           ` Ivan Shmakov
  2014-11-25 14:50             ` Stefan Monnier
  0 siblings, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-25  9:09 UTC (permalink / raw)
  To: 19152

>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

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

 > Options to circumvent bugs are a bad idea, in general (with
 > exceptions, of course, like everything, such as when the bug is
 > particularly hard to fix, or occurs in some code we can't control).

	Analogously speaking, isn’t --without-x-toolkit just an option
	to circumvent Gtk-related bugs?

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

 > An option to turn the feature off is fine.  An option to choose the
 > number of chars we have to gain is not.

	Why not?

	Diff-wise, the difference is two lines only: one in defcustom,
	to allow for an integer value for the option; the other in
	execute-extended-command--shorter, to replace the currently
	magic 5.

	That said, I’m fine with doing it either way.

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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25  9:09           ` Ivan Shmakov
@ 2014-11-25 14:50             ` Stefan Monnier
  2014-11-25 15:45               ` Ivan Shmakov
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2014-11-25 14:50 UTC (permalink / raw)
  To: 19152

>> Options to circumvent bugs are a bad idea, in general (with
>> exceptions, of course, like everything, such as when the bug is
>> particularly hard to fix, or occurs in some code we can't control).
> 	Analogously speaking, isn’t --without-x-toolkit just an option
> 	to circumvent Gtk-related bugs?

If it is, then it's OK because those bugs "occur in some code we can't control".

>> An option to turn the feature off is fine.  An option to choose the
>> number of chars we have to gain is not.
> 	Why not?

Because that exposes too much irrelevant details.

BTW, if you want to "turn it off" and can't wait for someone to install
such an option in the trunk, you can try:

   (advice-add 'execute-extended-command--shorter :override #'ignore)


-- Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25 14:50             ` Stefan Monnier
@ 2014-11-25 15:45               ` Ivan Shmakov
  2014-11-25 16:51                 ` Eli Zaretskii
  2014-11-25 17:38                 ` Stefan Monnier
  0 siblings, 2 replies; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-25 15:45 UTC (permalink / raw)
  To: 19152

>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

[…]

 >>> An option to turn the feature off is fine.  An option to choose the
 >>> number of chars we have to gain is not.

 >> Why not?

 > Because that exposes too much irrelevant details.

	I see no big difference between suggest-key-bindings’ seconds
	and the suggested suggest-shorter-command-limit’s characters.

 > BTW, if you want to "turn it off" and can't wait for someone to
 > install such an option in the trunk, you can try:

 >    (advice-add 'execute-extended-command--shorter :override #'ignore)

	Well, to quote myself [2]:

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

 > [1] http://debbugs.gnu.org/19013#msg30
   [2] news:87vbm5rsij.fsf_-_@violet.siamics.net

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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25 15:45               ` Ivan Shmakov
@ 2014-11-25 16:51                 ` Eli Zaretskii
  2014-11-25 18:10                   ` Ivan Shmakov
  2016-04-30 15:22                   ` Lars Ingebrigtsen
  2014-11-25 17:38                 ` Stefan Monnier
  1 sibling, 2 replies; 25+ messages in thread
From: Eli Zaretskii @ 2014-11-25 16:51 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 19152

> From: Ivan Shmakov <ivan@siamics.net>
> Date: Tue, 25 Nov 2014 15:45:18 +0000
> 
> >>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
> 
> […]
> 
>  >>> An option to turn the feature off is fine.  An option to choose the
>  >>> number of chars we have to gain is not.
> 
>  >> Why not?
> 
>  > Because that exposes too much irrelevant details.
> 
> 	I see no big difference between suggest-key-bindings’ seconds
> 	and the suggested suggest-shorter-command-limit’s characters.

Would you please rework your patch to make the option a simple
predicate that turns this feature on and off, and call it some name
that begins with extended-command?  I think there's a consensus that
such an option is OK.

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25 15:45               ` Ivan Shmakov
  2014-11-25 16:51                 ` Eli Zaretskii
@ 2014-11-25 17:38                 ` Stefan Monnier
  1 sibling, 0 replies; 25+ messages in thread
From: Stefan Monnier @ 2014-11-25 17:38 UTC (permalink / raw)
  To: 19152

> 	I see no big difference between suggest-key-bindings’ seconds
> 	and the suggested suggest-shorter-command-limit’s characters.

I don't either, except that one exists already, so it's more trouble to
remove it.


        Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  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
  1 sibling, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-11-25 18:10 UTC (permalink / raw)
  To: 19152

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

>>>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>>> From: Ivan Shmakov  Date: Tue, 25 Nov 2014 15:45:18 +0000
>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

 >>>>> An option to turn the feature off is fine.  An option to choose
 >>>>> the number of chars we have to gain is not.

 >>>> Why not?

 >>> Because that exposes too much irrelevant details.

 >> I see no big difference between suggest-key-bindings’ seconds and
 >> the suggested suggest-shorter-command-limit’s characters.

 > Would you please rework your patch to make the option a simple
 > predicate that turns this feature on and off,

	Sure…

 > and call it some name that begins with extended-command?

	… Even though that’s inconsistent with the name of the existing
	suggest-key-bindings option?…

 > I think there's a consensus that such an option is OK.

 > Thanks.

	… Please consider the patch MIMEd.

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

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

--- a/lisp/simple.el	2014-11-21 09:21:50 +0000
+++ b/lisp/simple.el
@@ -1598,6 +1598,11 @@
                  (integer :tag "time" 2)
                  (other :tag "on")))
 
+(defcustom extended-command-suggest-shorter t
+  "Non-nil means show a shorter M-x invocation when there is one."
+  :group 'keyboard
+  :type 'boolean)
+
 (defun execute-extended-command--shorter-1 (name length)
   (cond
    ((zerop length) (list ""))
@@ -1680,7 +1685,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 extended-command-suggest-shorter)
+                    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.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25 18:10                   ` Ivan Shmakov
@ 2014-11-26  2:22                     ` Stefan Monnier
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Monnier @ 2014-11-26  2:22 UTC (permalink / raw)
  To: 19152

> 	… Please consider the patch MIMEd.

Looks fine, feel free to install it,


        Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands
  2014-11-24  4:11     ` Stefan Monnier
  2014-11-24  7:01       ` bug#19013: bug#19152: " Ivan Shmakov
  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
  2 siblings, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2014-11-28 23:15 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 19152-done

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

Should be fixed now,


        Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-28 23:15       ` Stefan Monnier
@ 2014-12-02 10:14         ` Ivan Shmakov
  2014-12-02 13:57           ` Stefan Monnier
  0 siblings, 1 reply; 25+ messages in thread
From: Ivan Shmakov @ 2014-12-02 10:14 UTC (permalink / raw)
  To: 19152

>>>>> "SM" == Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>>>>> "IS" == Ivan Shmakov <ivan@siamics.net> writes:
>>>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:

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

 SM> Sounds like a plain bug.

 SM> Should be fixed now,

	Well, ac4532a23265 (2014-11-28 23:14:38Z) indeed fixes the issue
	above, but not quite #19152 as initially reported (below), which
	still needs something like the change I’ve previously suggested
	[1].

 DA> Please remove such silly messages, which do not tell users about a
 DA> *key sequence* bound to the command they entered.

	My apologies for contributing to the confusion.

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19152#msg68
    news:87tx1nqhgf.fsf@violet.siamics.net

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





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-12-02 10:14         ` bug#19152: " Ivan Shmakov
@ 2014-12-02 13:57           ` Stefan Monnier
  2016-03-09 11:37             ` Brendan O'Dea
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2014-12-02 13:57 UTC (permalink / raw)
  To: 19152

> 	Well, ac4532a23265 (2014-11-28 23:14:38Z) indeed fixes the issue
> 	above, but not quite #19152 as initially reported (below), which
> 	still needs something like the change I’ve previously suggested
> 	[1].

Indeed, this patch hasn't been installed yet.  Could someone take care
of it?


        Stefan





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-12-02 13:57           ` Stefan Monnier
@ 2016-03-09 11:37             ` Brendan O'Dea
  0 siblings, 0 replies; 25+ messages in thread
From: Brendan O'Dea @ 2016-03-09 11:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19152

On Tue, Dec 02, 2014 at 08:57:55AM -0500, Stefan Monnier wrote:
>> 	Well, ac4532a23265 (2014-11-28 23:14:38Z) indeed fixes the issue
>> 	above, but not quite #19152 as initially reported (below), which
>> 	still needs something like the change I’ve previously suggested
>> 	[1].
>
>Indeed, this patch hasn't been installed yet.  Could someone take care
>of it?

The suggested change[1] still doesn't appear to have been applied.  I can
advise the function out of existance as per [2], but a configuration option
would ssem to be preferable.  What needs to be done to get that patch applied?

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19152#68
[2] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19152#56

--bod





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#19152: 25.0.50; Suggestions for M-x commands
  2014-11-25 16:51                 ` Eli Zaretskii
  2014-11-25 18:10                   ` Ivan Shmakov
@ 2016-04-30 15:22                   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-30 15:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 19152, Ivan Shmakov

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ivan Shmakov <ivan@siamics.net>
>> Date: Tue, 25 Nov 2014 15:45:18 +0000
>> 
>> >>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>> 
>> […]
>> 
>>  >>> An option to turn the feature off is fine.  An option to choose the
>>  >>> number of chars we have to gain is not.
>> 
>>  >> Why not?
>> 
>>  > Because that exposes too much irrelevant details.
>> 
>> 	I see no big difference between suggest-key-bindings’ seconds
>> 	and the suggested suggest-shorter-command-limit’s characters.
>
> Would you please rework your patch to make the option a simple
> predicate that turns this feature on and off, and call it some name
> that begins with extended-command?  I think there's a consensus that
> such an option is OK.

This wasn't installed?  I'll install it with some documentation.

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





^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-04-30 15:22 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` bug#19152: " Ivan Shmakov
2014-11-24  4:11     ` 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

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