From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#34083: 27.0.50; Default completion, if it exists, should always sort to top Date: Tue, 15 Jan 2019 09:55:55 -0800 (PST) Message-ID: <3e721c33-2c05-4e3c-97a9-2511d432a2f2@default> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1547575011 14073 195.159.176.226 (15 Jan 2019 17:56:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2019 17:56:51 +0000 (UTC) Cc: monnier@iro.umontreal.ca To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 34083@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 18:56:47 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjSxB-0003Xh-LV for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2019 18:56:45 +0100 Original-Received: from localhost ([127.0.0.1]:35372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjSzI-0003V7-OH for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2019 12:58:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjSxW-0002W0-91 for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2019 12:57:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjSxS-0000N3-IE for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2019 12:57:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjSxS-0000LR-7y for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2019 12:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gjSxS-0001DQ-2o for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2019 12:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jan 2019 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34083 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 34083-submit@debbugs.gnu.org id=B34083.15475749674612 (code B ref 34083); Tue, 15 Jan 2019 17:57:02 +0000 Original-Received: (at 34083) by debbugs.gnu.org; 15 Jan 2019 17:56:07 +0000 Original-Received: from localhost ([127.0.0.1]:60333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjSwY-0001CJ-LJ for submit@debbugs.gnu.org; Tue, 15 Jan 2019 12:56:06 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:44478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjSwW-0001Bp-EE for 34083@debbugs.gnu.org; Tue, 15 Jan 2019 12:56:05 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0FHiGCe038773; Tue, 15 Jan 2019 17:55:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Q+jGTph3Q3nSDL6/06AMOq8/Ws8XtZO6eFoSh8ZmA0Y=; b=o0t6YATVdHu8sa/fOkuHkSN2MuR9khYValV1b3sh1m4focOo/liY37lJvoG07p5BgMJN E7UMIe87i1se4UUQKiN5h+IiRhJhVjy5nVk2wtkhmgW4WzcwEE1zw3WJHJsiFvKCRNNR gVhsGi+Jla1nZYbhyQj7DgJ8mKRAxXn1uFC/9ujr/7qkohDRGN0wfQGmjZ1PPFqdxXWR uJnu5H/Vqze7S/MHtcviQ+W05DKBtGMAXwGac9BdwEQxJn3pVWBPFZqsD2YBkJEvJXqE YWrn06pTTzZWhMSEQLMum4CH8Or9DSl6LwwNMVhQYSQxrW3hBVm4TU713z8V+M/TuNFr qQ== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2pybjnnd3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Jan 2019 17:55:58 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0FHtvLg005738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Jan 2019 17:55:57 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0FHtuee008783; Tue, 15 Jan 2019 17:55:56 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4783.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9137 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=881 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901150146 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:154453 Archived-At: > In completion-all-sorted-completions, completions are sorted according > to recency of usage, which is a good idea. >=20 > However, for calls to completing-read that are given a DEFAULT > (actually > DEF) argument, the sort order isn't very useful. It means that, when > using icomplete for i.e. M-x describe-symbol on top of the symbol sort >=20 > Describe symbol (default sort): { some-other-symbol | yet-another | > sort } > ^^^^^^^^^^^^^^^^^ > boldface >=20 > This is very confusing in icomplete as "some-other-symbol" in the > previous example is boldface and gives the idea of a default. It is > the > thing that minibuffer-force-complete-and-exit, bound to C-j, will > complete to immediately. But since no text has been entered, C-m will > make completion consider "sort" instead. >=20 > Here's a recipe: >=20 > Emacs -Q > M-x icomplete-mode > M-: (setq icomplete-show-matches-on-no-input t) RET > type "sort" > C-h o >=20 > Verify that "sort" is the default but it doesn't visually in the > "propects list". Instead "%" is made boldface and C-j and C-M-i will > immediately complete to it. >=20 > This inconsistency is easy to fix in minibuffer.el, as attached in a > patch. After the patch, "sort" is sorted to the top. >=20 > I couldn't figure exactly if there is an impact on non-icomplete.el > usage of completion-all-sorted-completions, because I'm not familiar > with that code. But since it was already using > minibuffer-history-variable, I don't think this disturbs it much more > than that. >=20 > Naturally, this could be coded to work in icomplete-mode only, but > doing that patch cleanly is much harder. Not a good idea, IMHO. Do I really care? My own code sorts completions differently, so I don't care with that in mind. But for vanilla Emacs I do care. The default value of `completing-read' has nothing to do with the current sort order or the first completion of that order. If someone thinks that Ido or Icomplete needs massaging in this way then that's where it should be done. Certainly not at the level of `completing-read' or (even worse) `minibuffer.el' (`completion-all-sorted-completions'). "boldface...gives the idea of a default" is an Ido/Icomplete thing. If their UIs need clarifying in this case then that's where to concentrate efforts. For example, perhaps a different face should be used when the default is not the first candidate. (No, I'm not proposing that or any other change for these UIs.) (I don't want to belabor this or put forth arguments for why this is a bad idea. If the why is not clear to others who read this bug thread, too bad.)