Fix edge case where package autoloads would break startup

Particularly in the case of gh loading eieio and marshal.
This commit is contained in:
Henrik Lissner 2018-05-16 00:57:28 +02:00
parent 63fdc3530c
commit 980f5e470b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -154,7 +154,8 @@ and `auto-mode-alist'.")
(with-temp-file doom-packages-file
(insert ";;; -*- lexical-binding:t -*-\n"
";; This file was autogenerated by `doom|refresh-cache', DO NOT EDIT!\n")
(prin1 `(setq Info-directory-list ',Info-directory-list
(prin1 `(setq load-path ',load-path
Info-directory-list ',Info-directory-list
doom-disabled-packages ',doom-disabled-packages
package-activated-list ',package-activated-list)
(current-buffer)))))
@ -197,13 +198,11 @@ FORCE-P is non-nil, do it anyway.
(require 'cl-lib)
(require 'map))
(cl-pushnew doom-core-dir load-path :test #'string=)
(require 'core-lib)
(when (or force-p (not doom-init-p))
;; autoloads file
(unless (load doom-autoload-file 'noerror 'nomessage 'nosuffix)
(unless noninteractive
(error "No autoloads file! Run make autoloads")))
;; packages.el cache
(when (and force-p (file-exists-p doom-packages-file))
(message "Deleting packages.el cache")
(delete-file doom-packages-file))
(unless (load doom-packages-file 'noerror 'nomessage 'nosuffix)
;; Ensure core folders exist, otherwise we get errors
@ -232,11 +231,14 @@ FORCE-P is non-nil, do it anyway.
(if (package-installed-p package)
(message "✓ Installed %s" package)
(error "✕ Couldn't install %s" package)))
(message "Installing core packages...done")))))
(message "Installing core packages...done"))))
;; autoloads file
(unless (quiet! (load doom-autoload-file 'noerror 'nomessage 'nosuffix))
(unless noninteractive
(error "No autoloads file! Run make autoloads"))))
;; initialize Doom core
(require 'core-lib)
(require 'core-os)
(unless doom-init-p
(unless (or doom-init-p noninteractive)
;; Cache important packages.el state
(doom|refresh-cache))
(unless noninteractive
@ -802,7 +804,7 @@ This should be run whenever init.el or an autoload file is modified. Running
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:\n")
(eval-buffer buf)
(quiet! (eval-buffer buf))
(save-buffer)
(message "Done!"))
('error