]> git.eshelyaron.com Git - emacs.git/commitdiff
Keep order of completion candidates (Bug#25995, Bug#24676)
authorNoam Postavsky <npostavs@gmail.com>
Wed, 21 Jun 2017 02:19:51 +0000 (22:19 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 21 Jun 2017 02:44:24 +0000 (22:44 -0400)
* 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.

lisp/minibuffer.el

index 0377cd549a2864dcf04d13573abb09fe956c6b48..c3480cd6c6488691532080743e1539f534c43434 100644 (file)
@@ -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)