Report ignored files w/ reloading autoloads

This commit is contained in:
Henrik Lissner 2017-11-16 16:35:46 +01:00
parent f21c01fce2
commit 5364260a5c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

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