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
13
lisp/doom.el
13
lisp/doom.el
|
@ -489,11 +489,18 @@ users).")
|
|||
inhibit-message nil)
|
||||
(redraw-frame))
|
||||
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
||||
(define-advice startup--load-user-init-file (:after (&rest _) undo-inhibit-vars)
|
||||
(when init-file-had-error
|
||||
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-inhibit-vars)
|
||||
(let (--init--)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(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))))
|
||||
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))))
|
||||
|
||||
;; PERF: Doom disables the UI elements by default, so that there's less
|
||||
;; for the frame to initialize. However, the toolbar is still populated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue