[Top][All Lists]

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

scratch/no-ls-lisp-advice 1da0fccc646 1/5: * lisp/files.el (file-expand-

From: Stefan Monnier
Subject: scratch/no-ls-lisp-advice 1da0fccc646 1/5: * lisp/files.el (file-expand-wildcards): Fix sorting of subdirs
Date: Sat, 9 Dec 2023 23:59:03 -0500 (EST)

branch: scratch/no-ls-lisp-advice
commit 1da0fccc646d1921782dd6d701bc86004cfb3732
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/files.el (file-expand-wildcards): Fix sorting of subdirs
    E.g. (file-expand-wildcards "/u*/*m*")
    returned ("/usr/games" "/u/dummy" "/u/monnier" "/u/omnibook-disk")
    instead of ("/u/dummy" "/u/monnier" "/u/omnibook-disk" "/usr/games").
 lisp/files.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 1cdcec23b11..047854d3939 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -7539,12 +7539,12 @@ default directory.  However, if FULL is non-nil, they 
are absolute."
           ;; if DIRPART contains wildcards.
           (dirs (if (and dirpart
                          (string-match "[[*?]" (file-local-name dirpart)))
-                    (mapcar 'file-name-as-directory
+                    (mapcar #'file-name-as-directory
                               (directory-file-name dirpart) nil regexp))
                   (list dirpart)))
-      (dolist (dir dirs)
+      (dolist (dir (nreverse dirs))
        (when (or (null dir)    ; Possible if DIRPART is not wild.
                  (file-accessible-directory-p dir))
          (let ((this-dir-contents

reply via email to

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