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