emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1ed2086: Keep order of completion candidates (Bug#2


From: Noam Postavsky
Subject: [Emacs-diffs] master 1ed2086: Keep order of completion candidates (Bug#25995, Bug#24676)
Date: Tue, 20 Jun 2017 22:44:41 -0400 (EDT)

branch: master
commit 1ed2086a03a5f33482d2f184e57dad9e6a9d25d8
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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.
---
 lisp/minibuffer.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 0377cd5..c3480cd 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]