Fix error if autoloads file is missing at startup

Should warn the user to run 'doom sync' if the autoloads file is
missing, but was giving a less helpful, generic error instead.
This commit is contained in:
Henrik Lissner 2020-11-20 14:08:29 -05:00
parent 03c6a352bf
commit db16e5c03e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -549,13 +549,13 @@ to least)."
(file-missing (file-missing
;; If the autoloads file fails to load then the user forgot to sync, or ;; If the autoloads file fails to load then the user forgot to sync, or
;; aborted a doom command midway! ;; aborted a doom command midway!
(if (equal (nth 3 e) doom-autoloads-file) (if (locate-file doom-autoloads-file load-path)
(signal 'doom-error ;; Something inside the autoloads file is triggering this error;
(list "Doom is in an incomplete state" ;; forward it to the caller!
"run 'doom sync' on the command line to repair it")) (signal 'doom-autoload-error e)
;; Otherwise, something inside the autoloads file is triggering this (signal 'doom-error
;; error; forward it! (list "Doom is in an incomplete state"
(signal 'doom-autoload-error e)))) "run 'doom sync' on the command line to repair it")))))
;; Load shell environment, optionally generated from 'doom env'. No need ;; Load shell environment, optionally generated from 'doom env'. No need
;; to do so if we're in terminal Emacs, where Emacs correctly inherits ;; to do so if we're in terminal Emacs, where Emacs correctly inherits