From 9f84bc334bc7e98e4df6e6e25576fcb5943b961e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 4 Aug 2020 07:34:16 -0400 Subject: [PATCH] Forward file-missing errors from within autoloads If a load call occurs within the autoloads file and throws a file-missing error, it would be misleading to say 'doom sync' will fix it, so forward the real error! --- core/core.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/core.el b/core/core.el index 29e6073d9..7c65fddce 100644 --- a/core/core.el +++ b/core/core.el @@ -514,9 +514,13 @@ to least)." (file-missing ;; If the autoloads file fails to load then the user forgot to sync, or ;; aborted a doom command midway! - (signal 'doom-error - (list "Doom is in an incomplete state" - "run 'bin/doom sync' on the command line to repair it")))) + (if (equal (nth 3 e) doom-autoload-file) + (signal 'doom-error + (list "Doom is in an incomplete state" + "run 'bin/doom sync' on the command line to repair it")) + ;; Otherwise, something inside the autoloads file is triggering this + ;; error; forward it! + (apply #'doom-autoload-error e)))) ;; Load shell environment, optionally generated from 'doom env'. No need ;; to do so if we're in terminal Emacs, where Emacs correctly inherits