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.
This commit is contained in:
Henrik Lissner 2018-05-30 01:43:56 +02:00
parent 75e6ea6bee
commit 6b1e1a2c58
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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)))