               (error "✕ Couldn't install %s" package)))
           (message "Installing core packages...done"))))
     ;; autoloads file
-    (unless
-        (with-demoted-errors "Autoload error: %s"
-          (let (byte-compile-warnings)
-            (load doom-autoload-file 'noerror 'nomessage 'nosuffix)))
-      (unless noninteractive
-        (error "No autoloads file! Run make autoloads")))
-    (cl-pushnew doom-core-dir load-path :test #'string=))
+    (condition-case-unless-debug e
+        (unless
+            (let (byte-compile-warnings)
+              (load (substring doom-autoload-file 0 -3) 'noerror 'nomessage))
+          (error "No autoloads file! Run make autoloads"))
+      (error
+       (funcall (if noninteractive #'warn #'error)
+                "Autoload file error: %s -> %s" (car e) (error-message-string e))))
+    (add-to-list 'load-path doom-core-dir))
   ;; initialize Doom core
   (require 'core-os)
   (unless noninteractive

              (push file targets)))))
      (when (file-exists-p doom-autoload-file)
        (delete-file doom-autoload-file)
        (message "Deleted old autoloads.el"))
      (message "Generating new autoloads.el")
      (dolist (file (mapcar #'file-truename (reverse targets)))


(defvar doom-disabled-packages ()
  "A list of packages that should be ignored by `def-package!'.")

(defvar doom-autoload-excluded-packages '(marshal gh)
  "Packages that have silly or destructive autoload files that try to load
everyone in the universe and their dog, causing errors that make babies cry. No
one wants that.")

(defvar doom-reload-hook nil
  "A list of hooks to run when `doom/reload-load-path' is called.")
