Add doom-run-hooks

Produces more helpful (and harder-to-miss) error messages when a hook
emits an error. Also advises run-hook when doom-debug-mode is active, so
errors in hooks (generally, major mode hooks) don't quietly go
unnoticed.
This commit is contained in:
Henrik Lissner 2021-05-05 16:12:35 -04:00
parent df10383a26
commit ff64a9d106
6 changed files with 35 additions and 20 deletions

View file

@ -77,13 +77,11 @@ symbol and CDR is the value to set it to when `doom-debug-mode' is activated.")
emacs -Q -l init.el -f doom-run-all-startup-hooks-h"
(setq after-init-time (current-time))
(let ((inhibit-startup-hooks nil))
(mapc (lambda (hook)
(run-hook-wrapped hook #'doom-try-run-hook))
'(after-init-hook
delayed-warnings-hook
emacs-startup-hook
tty-setup-hook
window-setup-hook))))
(doom-run-hooks 'after-init-hook
'delayed-warnings-hook
'emacs-startup-hook
'tty-setup-hook
'window-setup-hook)))
;;