From 6b1e1a2c58618b2528e4476a1702200fc42401f8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 30 May 2018 01:43:56 +0200 Subject: [PATCH] Fix doom-files-in returning files in arbitrary order This would cause compilation issues in doom//byte-compile because prerequisite files weren't compiled before dependent ones. --- core/core-lib.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 14e57df0a..4935f871e 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -105,6 +105,7 @@ This is used by `associate!', `file-exists-p!' and `project-file-exists-p!'." filter map full + nosort (follow-symlinks t) (type 'files) (relative-to (unless full default-directory)) @@ -137,10 +138,10 @@ MATCH is a string regexp. Only entries that match it will be included." nconc (apply #'doom-files-in path (plist-put rest :relative-to relative-to)))) ((let ((path path-or-paths) result) - (dolist (file (file-name-all-completions "" path)) - (unless (member file '("./" "../")) + (dolist (file (directory-files path nil "." nosort)) + (unless (member file '("." "..")) (let ((fullpath (expand-file-name file path))) - (cond ((directory-name-p fullpath) + (cond ((file-directory-p fullpath) (when (and (memq type '(t dirs)) (string-match-p match file) (not (and filter (funcall filter fullpath)))