Improve how reload-package-autoloads detects your packages have changed

This commit is contained in:
Henrik Lissner 2018-05-25 18:20:01 +02:00
parent 74c8df3618
commit e3daf2b818
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -197,11 +197,7 @@ This should be run whenever your `doom!' block or update your packages."
(interactive) (interactive)
(if (and (not force-p) (if (and (not force-p)
(file-exists-p doom-package-autoload-file) (file-exists-p doom-package-autoload-file)
(not (cl-loop initially do (doom-ensure-packages-initialized t) (not (file-newer-than-file-p package-user-dir doom-package-autoload-file)))
for (_pkg desc) in package-alist
for autoload-file = (concat (package--autoloads-file-name desc) ".el")
if (file-newer-than-file-p autoload-file doom-package-autoload-file)
return t)))
(ignore (print! (green "Doom package autoloads is up-to-date")) (ignore (print! (green "Doom package autoloads is up-to-date"))
(doom-initialize-autoloads doom-package-autoload-file)) (doom-initialize-autoloads doom-package-autoload-file))
(doom-delete-autoloads-file doom-package-autoload-file) (doom-delete-autoloads-file doom-package-autoload-file)
@ -210,7 +206,7 @@ This should be run whenever your `doom!' block or update your packages."
";; This file is autogenerated by `doom//reload-package-autoloads', DO NOT EDIT !!\n\n") ";; This file is autogenerated by `doom//reload-package-autoloads', DO NOT EDIT !!\n\n")
(save-excursion (save-excursion
;; Cache the important and expensive-to-initialize state here. ;; Cache the important and expensive-to-initialize state here.
(doom-initialize-packages 'internal) (doom-initialize-packages)
(prin1 `(setq load-path ',load-path (prin1 `(setq load-path ',load-path
auto-mode-alist ',auto-mode-alist auto-mode-alist ',auto-mode-alist
Info-directory-list ',Info-directory-list Info-directory-list ',Info-directory-list