From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#24676: 25.1; `completion-pcm-all-completions' should not reverse order of candidates Date: Mon, 17 Oct 2016 10:19:54 +0200 Message-ID: <8737jvjsk5.fsf@web.de> References: <39f09e8d-8381-4176-917e-35cf12a9ae90@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476692480 6300 195.159.176.226 (17 Oct 2016 08:21:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 08:21:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: 24676@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 10:21:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw3AY-0000pR-54 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 10:21:14 +0200 Original-Received: from localhost ([::1]:59719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3Aa-0002TK-3Y for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 04:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3AQ-0002Qt-1Q for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw3AL-0001C8-Vw for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58059) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw3AL-0001Bn-TE for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:21:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bw3AL-0008DF-Ix for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 04:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Oct 2016 08:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24676-submit@debbugs.gnu.org id=B24676.147669243531523 (code B ref 24676); Mon, 17 Oct 2016 08:21:01 +0000 Original-Received: (at 24676) by debbugs.gnu.org; 17 Oct 2016 08:20:35 +0000 Original-Received: from localhost ([127.0.0.1]:36016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw39v-0008CN-HW for submit@debbugs.gnu.org; Mon, 17 Oct 2016 04:20:35 -0400 Original-Received: from mout.web.de ([217.72.192.78]:50222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw39t-0008CA-Kt for 24676@debbugs.gnu.org; Mon, 17 Oct 2016 04:20:34 -0400 Original-Received: from drachen.dragon ([90.186.3.40]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MYeys-1cRWJp381i-00VORK; Mon, 17 Oct 2016 10:20:24 +0200 In-Reply-To: <39f09e8d-8381-4176-917e-35cf12a9ae90@default> (Drew Adams's message of "Wed, 12 Oct 2016 09:56:32 -0700 (PDT)") X-Provags-ID: V03:K0:wUEn5PcXUZfL5yghuld9Nop2ib9rnHlCyxnkjT4z/8z3r4fim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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: 208.118.235.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:124583 Archived-At: Hello, > Because of this part, at the end of the function, > `completion-pcm-all-completions' reverses the order of the candidates. > > (let ((poss ())) > (dolist (c compl) > (when (string-match-p regex c) (push c poss))) ; <==== reverses > poss) > > It should not do this. Users should be able to depend on whatever order > the candidates are already in (as returned by `all-completions'). > > For example, for buffer candidates, the default order from > `all-completions' is last-display-time order. > > The fix is trivial: > > (let ((poss ())) > (dolist (c compl) > (when (string-match-p regex c) (push c poss))) > (nreverse poss)) Ah, this is the reason for the candidate list reversion I see. Yes, this should IMO not happen. Stefan, if you get the time, can you please have a look at whether the suggested fix looks ok to you, and commit it if applicable? Thanks, Michael.