doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t - MATCH's new default regexp excludes files that start with underscore.
This commit is contained in:
parent
39faabab6a
commit
5e9c020c21
8 changed files with 23 additions and 18 deletions
|
@ -44,7 +44,7 @@ ready to be pasted in a bug report on github."
|
|||
(length (doom-files-in `(,@doom-modules-dirs
|
||||
,doom-core-dir
|
||||
,doom-private-dir)
|
||||
:type 'files :match "\\.elc$"))
|
||||
:type 'files :match "\\.elc$" :sort nil))
|
||||
(if IS-WINDOWS
|
||||
"n/a"
|
||||
(with-temp-buffer
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
filter
|
||||
map
|
||||
full
|
||||
nosort
|
||||
(sort t) ; TODO Allow a function for custom sorting?
|
||||
(follow-symlinks t)
|
||||
(type 'files)
|
||||
(relative-to (unless full default-directory))
|
||||
(depth 99999)
|
||||
(mindepth 0)
|
||||
(match "/[^.]"))
|
||||
(match "/[^._]"))
|
||||
"Returns a list of files/directories in PATH-OR-PATHS (one string path or a
|
||||
list of them).
|
||||
|
||||
|
@ -45,7 +45,7 @@ MATCH is a string regexp. Only entries that match it will be included."
|
|||
((let ((path path-or-paths)
|
||||
result)
|
||||
(when (file-directory-p path)
|
||||
(dolist (file (directory-files path nil "." nosort))
|
||||
(dolist (file (directory-files path nil "." sort))
|
||||
(unless (member file '("." ".."))
|
||||
(let ((fullpath (expand-file-name file path)))
|
||||
(cond ((file-directory-p fullpath)
|
||||
|
|
|
@ -194,9 +194,11 @@ selection of all minor-modes, active or not."
|
|||
"Search headlines in Doom's newsletters."
|
||||
(interactive)
|
||||
(doom-completing-read-org-headings
|
||||
"Find in News: " (doom-files-in (expand-file-name "news" doom-docs-dir)
|
||||
"Find in News: "
|
||||
(nreverse (doom-files-in (expand-file-name "news" doom-docs-dir)
|
||||
:match "/[0-9]"
|
||||
:relative-to doom-docs-dir)
|
||||
:relative-to doom-docs-dir
|
||||
:sort t))
|
||||
nil t initial-input))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
@ -362,7 +362,8 @@ ones."
|
|||
(doom-files-in doom-modules-dir
|
||||
:depth 2
|
||||
:full t
|
||||
:match "/packages\\.el$"))
|
||||
:match "/packages\\.el$"
|
||||
:sort nil))
|
||||
(cl-loop for key being the hash-keys of doom-modules
|
||||
for path = (doom-module-path (car key) (cdr key) "packages.el")
|
||||
for doom--current-module = key
|
||||
|
|
|
@ -255,7 +255,7 @@ Run this whenever your `doom!' block, or a module autoload file, is modified."
|
|||
(when (file-exists-p auto-file)
|
||||
(push auto-file targets)
|
||||
(if module-p (push auto-file enabled-targets)))
|
||||
(dolist (file (doom-files-in auto-dir :match "\\.el$" :full t))
|
||||
(dolist (file (doom-files-in auto-dir :match "\\.el$" :full t :sort nil))
|
||||
(push file targets)
|
||||
(if module-p (push file enabled-targets)))))
|
||||
(if (and (not force-p)
|
||||
|
|
|
@ -108,7 +108,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
|||
;; Assemble el files we want to compile; taking into account that
|
||||
;; MODULES may be a list of MODULE/SUBMODULE strings from the command
|
||||
;; line.
|
||||
(let ((target-files (doom-files-in targets :filter #'doom--byte-compile-ignore-file-p)))
|
||||
(let ((target-files (doom-files-in targets :filter #'doom--byte-compile-ignore-file-p :sort nil)))
|
||||
(when (or (not modules)
|
||||
(member ":core" modules))
|
||||
(push (expand-file-name "init.el" doom-emacs-dir)
|
||||
|
@ -175,10 +175,10 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
|||
module. This does not include your byte-compiled, third party packages.'"
|
||||
(cl-loop with default-directory = doom-emacs-dir
|
||||
for path
|
||||
in (append (doom-files-in doom-emacs-dir :match "\\.elc$" :depth 0)
|
||||
(doom-files-in doom-private-dir :match "\\.elc$" :depth 1)
|
||||
(doom-files-in doom-core-dir :match "\\.elc$")
|
||||
(doom-files-in doom-modules-dirs :match "\\.elc$" :depth 4))
|
||||
in (append (doom-files-in doom-emacs-dir :match "\\.elc$" :depth 0 :sort nil)
|
||||
(doom-files-in doom-private-dir :match "\\.elc$" :depth 1 :sort nil)
|
||||
(doom-files-in doom-core-dir :match "\\.elc$" :sort nil)
|
||||
(doom-files-in doom-modules-dirs :match "\\.elc$" :depth 4 :sort nil))
|
||||
for truepath = (file-truename path)
|
||||
if (file-exists-p path)
|
||||
do (delete-file path)
|
||||
|
|
|
@ -32,7 +32,7 @@ If neither is available, run all tests in all enabled modules."
|
|||
nconc (cl-loop for dir in doom-modules-dirs
|
||||
for path = (expand-file-name arg dir)
|
||||
if (file-directory-p path)
|
||||
nconc (doom-files-in path :type 'dirs :depth 1 :full t))
|
||||
nconc (doom-files-in path :type 'dirs :depth 1 :full t :sort nil))
|
||||
finally do (setq argv nil))))
|
||||
|
||||
(modules ; cons-cells given to MODULES
|
||||
|
|
|
@ -195,15 +195,17 @@ This doesn't require modules to be enabled. For enabled modules us
|
|||
(intern module))))))))
|
||||
|
||||
(defun doom-module-load-path (&optional all-p)
|
||||
"Return a list of absolute file paths to activated modules. If ALL-P is
|
||||
non-nil, return paths of possible modules, activated or otherwise."
|
||||
"Return an unsorted list of absolute file paths to activated modules.
|
||||
|
||||
If ALL-P is non-nil, return paths of possible modules, activated or otherwise."
|
||||
(declare (pure t) (side-effect-free t))
|
||||
(append (if all-p
|
||||
(doom-files-in doom-modules-dirs
|
||||
:type 'dirs
|
||||
:mindepth 1
|
||||
:depth 1
|
||||
:full t)
|
||||
:full t
|
||||
:sort nil)
|
||||
(cl-loop for plist being the hash-values of (doom-modules)
|
||||
collect (plist-get plist :path)))
|
||||
(list doom-private-dir)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue