Refactor autoloads init & error handling

Also reduces byte-compiled forms in the backtrace of a
doom-autoload-error.
This commit is contained in:
Henrik Lissner 2018-06-19 17:19:11 +02:00
parent 279ee3cc8c
commit 0fefc43d39
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 17 additions and 11 deletions

View file

@ -373,6 +373,15 @@ to least)."
(require 'core-projects)
(require 'core-keybinds)))
(defun doom-initialize-autoloads (file)
"Tries to load FILE (an autoloads file). Return t on success, nil otherwise."
(condition-case e
(load (file-name-sans-extension file) 'noerror 'nomessage)
((debug error)
(if noninteractive
(message "Autoload file warning: %s -> %s" (car e) (error-message-string e))
(signal 'doom-autoload-error (list (file-name-nondirectory file) e))))))
;;
;; Bootstrap Doom