Run doom-post-init-hook as late as possible

Possibly fixes recursive load errors, to do with
kill-buffer-query-functions and buffer-predicate autoloads loading in a
weird way on Emacs 25 (and especially on MacOS, for some reason).
This commit is contained in:
Henrik Lissner 2018-08-21 04:03:05 +02:00
parent ee73d6c9af
commit da7f9019d1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 3 deletions

View file

@ -56,7 +56,13 @@ non-nil."
(load! "config" (plist-get plist :path) t)))
doom-modules)
(load! "config" doom-private-dir t)
(run-hook-wrapped 'doom-post-init-hook #'doom-try-run-hook))))
(if after-init-time
(doom|run-post-init-hook)
(add-hook 'emacs-startup-hook #'doom|run-post-init-hook)))))
(defun doom|run-post-init-hook ()
"Run `doom-post-init-hook'. That's all."
(run-hook-wrapped 'doom-post-init-hook #'doom-try-run-hook))
;;

View file

@ -233,7 +233,7 @@ original value of `symbol-file'."
module init.el files, but before their config.el files are loaded.")
(defvar doom-post-init-hook nil
"A list of hooks run when Doom is fully initialized. Fires at the end of
"A list of hooks run when Doom is fully initialized. Fires near the end of
`emacs-startup-hook', as late as possible. Guaranteed to run after everything
else (except for `window-setup-hook').")
@ -305,7 +305,7 @@ and `doom-exit-window-hook'."
(if disable
(advice-remove (car spec) (cdr spec))
(advice-add (car spec) :around (cdr spec)))))
(add-hook 'emacs-startup-hook #'doom|init-switch-hooks)
(add-hook 'doom-post-init-hook #'doom|init-switch-hooks)
(defun doom*load-theme-hooks (theme &rest _)
"Set up `doom-load-theme-hook' to run after `load-theme' is called."