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: 25.0.50; Suggestions for M-x commands Date: Tue, 25 Nov 2014 18:10:40 +0000 Message-ID: <87tx1nqhgf.fsf@violet.siamics.net> References: <87y4r77jbn.fsf@violet.siamics.net> <87lhn2uodm.fsf@violet.siamics.net> <87vbm5rsij.fsf_-_@violet.siamics.net> <87lhmzsl2q.fsf_-_@violet.siamics.net> <8761e3s2r5.fsf@violet.siamics.net> <83ioi3p6jv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1416939089 19249 80.91.229.3 (25 Nov 2014 18:11:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2014 18:11:29 +0000 (UTC) To: 19152@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 25 19:11:24 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 1XtKa6-0000Rt-Su for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 19:11:19 +0100 Original-Received: from localhost ([::1]:58852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtKa6-00005K-Cu for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 13:11:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtKZy-0008Pj-Gi for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 13:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtKZs-0007bV-AC for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 13:11:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtKZq-0007ZV-J7 for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 13:11:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XtKZq-0002jU-1y for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 13:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Nov 2014 18:11:01 +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.141693905310479 (code B ref 19152); Tue, 25 Nov 2014 18:11:01 +0000 Original-Received: (at 19152) by debbugs.gnu.org; 25 Nov 2014 18:10:53 +0000 Original-Received: from localhost ([127.0.0.1]:45214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtKZg-0002ix-Qr for submit@debbugs.gnu.org; Tue, 25 Nov 2014 13:10:53 -0500 Original-Received: from fely.am-1.org ([78.47.74.50]:42343) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtKZe-0002ik-Pe for 19152@debbugs.gnu.org; Tue, 25 Nov 2014 13:10:51 -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=9cL7JaYztap69kmAqEHqe8ruB5TJm77FV5t2gl+RaG0=; b=NUq9hlprtB3Fhwwvx7jbAUDAFCw/2Luyj8PshtliSIwvzJ9w74sS8T5crbAdjqf7LIyxfsTbio/lmQ0BhNb5d3VdDzgqhFiFUpgrMVD4skumlwzcklY3XxinJTxZ2ZYJ1RHNvBYI/wlen/Y2q6QSI/31gKjMB7nPMPolRb6lLjM=; 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 1XtKZb-0005Lz-Lq for 19152@debbugs.gnu.org; Tue, 25 Nov 2014 18:10:48 +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 1XtKZU-0001vu-Mi for 19152@debbugs.gnu.org; Wed, 26 Nov 2014 01:10:40 +0700 Mail-Followup-To: 19152@debbugs.gnu.org In-Reply-To: <83ioi3p6jv.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 Nov 2014 18:51:32 +0200") 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:96561 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> Eli Zaretskii writes: >>>>> From: Ivan Shmakov Date: Tue, 25 Nov 2014 15:45:18 +0000 >>>>> Stefan Monnier 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=E2=80=99 seconds a= nd >> the suggested suggest-shorter-command-limit=E2=80=99s characters. > Would you please rework your patch to make the option a simple > predicate that turns this feature on and off, Sure=E2=80=A6 > and call it some name that begins with extended-command? =E2=80=A6 Even though that=E2=80=99s inconsistent with the name of the exi= sting suggest-key-bindings option?=E2=80=A6 > I think there's a consensus that such an option is OK. > Thanks. =E2=80=A6 Please consider the patch MIMEd. --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 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 @@ -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. --=-=-=--