fix: ensure inhibit-* is reset on startup error

This commit is contained in:
Henrik Lissner 2024-03-19 20:30:11 -04:00
parent b6e7bbbe07
commit 5e7c769315
No known key found for this signature in database
GPG Key ID: B60957CA074D39A3

View File

@ -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
(doom--reset-inhibited-vars-h))
(unless (default-toplevel-value 'mode-line-format)
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))
(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))))))
;; PERF: Doom disables the UI elements by default, so that there's less
;; for the frame to initialize. However, the toolbar is still populated