Move emacs version check into doom-initialize

Also fixes void-function errors caused by (now removed)
doom-same-emacs-version-p not being defined in all the contexts it was
needed.

Where it was before was clumsy design.
This commit is contained in:
Henrik Lissner 2018-06-05 11:18:36 +02:00
parent 7b1a83079d
commit 282e0d6653
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 33 additions and 32 deletions

View file

@ -117,13 +117,13 @@ modified."
(dolist (file (doom-files-in auto-dir :match "\\.el$" :full t))
(push file targets)))))
(if (and (not force-p)
(not doom-emacs-changed-p)
(file-exists-p doom-autoload-file)
(not (file-newer-than-file-p (expand-file-name "init.el" doom-private-dir)
doom-autoload-file))
(not (cl-loop for file in targets
if (file-newer-than-file-p file doom-autoload-file)
return t))
(doom-same-emacs-version-p))
return t)))
(ignore (print! (green "Doom core autoloads is up-to-date"))
(doom-initialize-autoloads doom-autoload-file))
(doom-delete-autoloads-file doom-autoload-file)
@ -197,14 +197,14 @@ FORCE-P (universal argument) is non-nil, regenerate it anyway.
This should be run whenever your `doom!' block or update your packages."
(interactive)
(if (and (not force-p)
(not doom-emacs-changed-p)
(file-exists-p doom-package-autoload-file)
(not (file-newer-than-file-p package-user-dir doom-package-autoload-file))
(not (ignore-errors
(cl-loop for key being the hash-keys of (doom-module-table)
for path = (doom-module-path (car key) (cdr key) "packages.el")
if (file-newer-than-file-p path doom-package-autoload-file)
return t)))
(doom-same-emacs-version-p))
return t))))
(ignore (print! (green "Doom package autoloads is up-to-date"))
(doom-initialize-autoloads doom-package-autoload-file))
(doom-delete-autoloads-file doom-package-autoload-file)
@ -317,8 +317,8 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
(unless recompile-p
(doom//clean-byte-compiled-files))
(unless targets
(message "Regenerating autoloads files (if necessary)")
(let ((inhibit-message t)
doom-emacs-changed-p
noninteractive)
;; But first we must be sure that Doom and your private config have
;; been fully loaded. Which usually aren't so in an noninteractive