Force make commands to traverse symlinks too

This commit is contained in:
Henrik Lissner 2018-01-29 23:04:27 -05:00
parent e55e798048
commit 1fda25ce9a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 14 additions and 8 deletions

View file

@ -3,7 +3,7 @@ EMACS_FLAGS=--eval '(setq user-emacs-directory default-directory)' -l core/core.
EMACS=emacs --quick --batch $(EMACS_FLAGS) EMACS=emacs --quick --batch $(EMACS_FLAGS)
EMACSI=emacs -q $(EMACS_FLAGS) EMACSI=emacs -q $(EMACS_FLAGS)
MODULES=$(patsubst modules/%, %, $(shell find modules/ -maxdepth 2 -type d)) MODULES=$(patsubst modules/%, %, $(shell find -L modules/ -maxdepth 2 -type d))
all: autoloads autoremove install all: autoloads autoremove install

View file

@ -496,6 +496,11 @@ loads MODULE SUBMODULE's packages.el file."
(while compilation-in-progress (while compilation-in-progress
(sit-for 1)))) (sit-for 1))))
(defun doom-packages--files (dir pattern)
"Like `directory-files-recursively', but traverses symlinks."
(cl-letf (((symbol-function #'file-symlink-p) #'ignore))
(directory-files-recursively dir pattern)))
(defun doom//reload-load-path () (defun doom//reload-load-path ()
"Reload `load-path' and recompile files (if necessary). "Reload `load-path' and recompile files (if necessary).
@ -546,7 +551,7 @@ This should be run whenever init.el or an autoload file is modified. Running
(when (file-exists-p auto-file) (when (file-exists-p auto-file)
(push auto-file targets)) (push auto-file targets))
(when (file-directory-p auto-dir) (when (file-directory-p auto-dir)
(dolist (file (directory-files-recursively auto-dir "\\.el$")) (dolist (file (doom-packages--files auto-dir "\\.el$"))
(push file targets))))) (push file targets)))))
(when (file-exists-p doom-autoload-file) (when (file-exists-p doom-autoload-file)
(delete-file doom-autoload-file) (delete-file doom-autoload-file)
@ -617,11 +622,11 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
(cl-loop for target (cl-loop for target
in (or modules (append (list doom-core-dir) (doom-module-paths))) in (or modules (append (list doom-core-dir) (doom-module-paths)))
if (equal target "core") if (equal target "core")
nconc (nreverse (directory-files-recursively doom-core-dir "\\.el$")) nconc (nreverse (doom-packages--files doom-core-dir "\\.el$"))
else if (file-directory-p target) else if (file-directory-p target)
nconc (nreverse (directory-files-recursively target "\\.el$")) nconc (nreverse (doom-packages--files target "\\.el$"))
else if (file-directory-p (expand-file-name target doom-modules-dir)) else if (file-directory-p (expand-file-name target doom-modules-dir))
nconc (nreverse (directory-files-recursively (expand-file-name target doom-modules-dir) "\\.el$")) nconc (nreverse (doom-packages--files (expand-file-name target doom-modules-dir) "\\.el$"))
else if (file-exists-p target) else if (file-exists-p target)
collect target collect target
finally do (setq argv nil))) finally do (setq argv nil)))
@ -691,9 +696,10 @@ If RECOMPILE-P is non-nil, only recompile out-of-date core files."
"Delete all the compiled elc files in your Emacs configuration. This excludes "Delete all the compiled elc files in your Emacs configuration. This excludes
compiled packages.'" compiled packages.'"
(interactive) (interactive)
(let ((targets (append (list (expand-file-name "init.elc" doom-emacs-dir)) (let ((targets
(directory-files-recursively doom-core-dir "\\.elc$") (append (list (expand-file-name "init.elc" doom-emacs-dir))
(directory-files-recursively doom-modules-dir "\\.elc$"))) (doom-packages--files doom-core-dir "\\.elc$")
(doom-packages--files doom-modules-dir "\\.elc$")))
(default-directory doom-emacs-dir)) (default-directory doom-emacs-dir))
(unless (cl-loop for path in targets (unless (cl-loop for path in targets
if (file-exists-p path) if (file-exists-p path)