summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-06-20 22:19:51 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-06-20 22:44:24 -0400
commit1ed2086a03a5f33482d2f184e57dad9e6a9d25d8 (patch)
treee6da686ba7192c834c8cb8c6163366ac6517bfd7
parentd2ea4aee02a40b76b4e221c46ecb58270c2e1ca7 (diff)
downloademacs-1ed2086a03a5f33482d2f184e57dad9e6a9d25d8.tar.gz
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.
-rw-r--r--lisp/minibuffer.el4
1 files changed, 2 insertions, 2 deletions
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)