diff --git a/core/core-packages.el b/core/core-packages.el index e3ed9c5a3..46cdf289d 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -558,22 +558,21 @@ This should be run whenever init.el or an autoload file is modified. Running (dolist (path (doom-module-paths)) (let ((auto-dir (expand-file-name "autoload" path)) (auto-file (expand-file-name "autoload.el" path))) - (when (and (file-exists-p auto-file) - (doom-packages--read-if-cookies auto-file)) + (when (file-exists-p auto-file) (push auto-file targets)) (when (file-directory-p auto-dir) - (dolist (file (file-expand-wildcards (expand-file-name "*.el" auto-dir) t)) - ;; Make evil*.el autoload files a special case; don't load - ;; them unless evil is enabled. - (when (doom-packages--read-if-cookies file) - (push file targets)))))) + (dolist (file (directory-files-recursively auto-dir "\\.el$")) + (push file targets))))) (when (file-exists-p doom-autoload-file) (delete-file doom-autoload-file) (message "Deleted old autoloads.el")) (dolist (file (reverse targets)) - (message (if (update-file-autoloads file nil doom-autoload-file) - "Nothing in %s" - "Scanned %s") + (message (cond ((not (doom-packages--read-if-cookies file)) + "Ignoring %s") + ((update-file-autoloads file nil doom-autoload-file) + "Nothing in %s") + (t + "Scanned %s")) (file-relative-name file doom-emacs-dir))) (let ((buf (get-file-buffer doom-autoload-file)) current-sexp)