From: Noam Postavsky Date: Wed, 21 Jun 2017 02:19:51 +0000 (-0400) Subject: Keep order of completion candidates (Bug#25995, Bug#24676) X-Git-Tag: emacs-26.0.90~521^2~25 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ed2086a03a5f33482d2f184e57dad9e6a9d25d8;p=emacs.git Keep order of completion candidates (Bug#25995, Bug#24676) * lisp/minibuffer.el (completion-pcm--filename-try-filter) (completion-pcm--all-completions): Use nreverse to undo the reversing caused by using push in the loop. --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 0377cd549a2..c3480cd6c64 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3006,7 +3006,7 @@ PATTERN is as returned by `completion-pcm--string->pattern'." (let ((poss ())) (dolist (c compl) (when (string-match-p regex c) (push c poss))) - poss))))) + (nreverse poss)))))) (defun completion-pcm--hilit-commonality (pattern completions) (when completions @@ -3258,7 +3258,7 @@ the same set of elements." "\\)\\'"))) (dolist (f all) (unless (string-match-p re f) (push f try))) - (or try all)))) + (or (nreverse try) all)))) (defun completion-pcm--merge-try (pattern all prefix suffix)