From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#19152: bug#19013: 25.0.50; Suggestions for M-x commands Date: Sun, 23 Nov 2014 11:50:45 +0000 Message-ID: <87lhn2uodm.fsf@violet.siamics.net> References: <87y4r77jbn.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1416743544 12756 80.91.229.3 (23 Nov 2014 11:52:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2014 11:52:24 +0000 (UTC) To: 19013@debbugs.gnu.org, 19152@debbugs.gnu.org, 19152-submitter@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 23 12:52:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XsViC-0005qd-AD for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Nov 2014 12:52:16 +0100 Original-Received: from localhost ([::1]:48353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsViB-0004lg-TE for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Nov 2014 06:52:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsVi4-0004lW-JI for bug-gnu-emacs@gnu.org; Sun, 23 Nov 2014 06:52:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsVhz-0005tP-Gh for bug-gnu-emacs@gnu.org; Sun, 23 Nov 2014 06:52:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsVhz-0005tH-8Z for bug-gnu-emacs@gnu.org; Sun, 23 Nov 2014 06:52:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XsVhz-0002IX-1b for bug-gnu-emacs@gnu.org; Sun, 23 Nov 2014 06:52:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Nov 2014 11:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19152-submit@debbugs.gnu.org id=B19152.14167434908776 (code B ref 19152); Sun, 23 Nov 2014 11:52:02 +0000 Original-Received: (at 19152) by debbugs.gnu.org; 23 Nov 2014 11:51:30 +0000 Original-Received: from localhost ([127.0.0.1]:42222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsVhR-0002HO-LT for submit@debbugs.gnu.org; Sun, 23 Nov 2014 06:51:29 -0500 Original-Received: from fely.am-1.org ([78.47.74.50]:41998) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsVhO-0002H0-AD; Sun, 23 Nov 2014 06:51:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=klhrTv0wnMAwmhIU0ipXCCnRI3rkXwQRCh1vmsXdkL4=; b=VO+qhkAe/OHtq5ZZOEFrR/pY0gipBjY1Lj158f0kJ0BlkMJ0BiHvmjKSJV11+1+QY4I/djuqj1lGlDZ5lvccJ+mGxV1b/30XraISPBBfgz8kBo4mlM+6Oskq2kRrDDdUe2IHtqEaOFme2BLR0SU8nYNJ5H/heQ4B9rITNZuGvTs=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XsVhH-0005XM-16; Sun, 23 Nov 2014 11:51:19 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XsVgk-0004dk-NU; Sun, 23 Nov 2014 18:50:46 +0700 In-Reply-To: <87y4r77jbn.fsf@violet.siamics.net> (Ivan Shmakov's message of "Wed, 19 Nov 2014 07:14:52 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96448 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> Ivan Shmakov writes: (BTW, what about merging #19013 and #19152?) [=E2=80=A6] > M-x beginning-of-visual-line RET; then, after some time, =E2=80=93 M-x <= up> > RET =E2=80=93 the same message gets shown, even though M-x is for s= ure > 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=E2=80=99ve 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. --=20 FSF associate member #7257 np. Your Leaving =E2=80=94 Jami Sieber =E2=80= =A6 B6A0 230E 334A --=-=-= Content-Type: text/diff Content-Disposition: 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. --=-=-=--