fix: ensure inhibit-* is reset on startup error
This commit is contained in:
parent
b6e7bbbe07
commit
5e7c769315
1 changed files with 12 additions and 5 deletions
17
lisp/doom.el
17
lisp/doom.el
|
@ -489,11 +489,18 @@ users).")
|
||||||
inhibit-message nil)
|
inhibit-message nil)
|
||||||
(redraw-frame))
|
(redraw-frame))
|
||||||
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
||||||
(define-advice startup--load-user-init-file (:after (&rest _) undo-inhibit-vars)
|
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-inhibit-vars)
|
||||||
(when init-file-had-error
|
(let (--init--)
|
||||||
(doom--reset-inhibited-vars-h))
|
(unwind-protect
|
||||||
(unless (default-toplevel-value 'mode-line-format)
|
(progn
|
||||||
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))
|
(apply fn args)
|
||||||
|
(setq --init-- t))
|
||||||
|
(when (or (not --init--) init-file-had-error)
|
||||||
|
;; If we don't undo our inhibit-{message,redisplay} and there's an
|
||||||
|
;; error, we'll see nothing but a blank Emacs frame.
|
||||||
|
(doom--reset-inhibited-vars-h))
|
||||||
|
(unless (default-toplevel-value 'mode-line-format)
|
||||||
|
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))))
|
||||||
|
|
||||||
;; PERF: Doom disables the UI elements by default, so that there's less
|
;; PERF: Doom disables the UI elements by default, so that there's less
|
||||||
;; for the frame to initialize. However, the toolbar is still populated
|
;; for the frame to initialize. However, the toolbar is still populated
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue