unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 24676@debbugs.gnu.org
Subject: bug#24676: 25.1; `completion-pcm-all-completions' should not reverse order of candidates
Date: Mon, 17 Oct 2016 10:19:54 +0200	[thread overview]
Message-ID: <8737jvjsk5.fsf@web.de> (raw)
In-Reply-To: <39f09e8d-8381-4176-917e-35cf12a9ae90@default> (Drew Adams's message of "Wed, 12 Oct 2016 09:56:32 -0700 (PDT)")

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.





  reply	other threads:[~2016-10-17  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 16:56 bug#24676: 25.1; `completion-pcm-all-completions' should not reverse order of candidates Drew Adams
2016-10-17  8:19 ` Michael Heerdegen [this message]
2016-10-17 16:29 ` Stefan Monnier
2016-10-18  8:11   ` Michael Heerdegen
2016-10-18 13:56     ` Drew Adams
2016-10-18 14:22       ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737jvjsk5.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=24676@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).