fix: suppress visual startup optimizations in debug mode

Also interferes with doom/sandbox's launch targets.
This commit is contained in:
Henrik Lissner 2024-09-11 13:57:01 -04:00
parent a8515034de
commit 546e56f1fa
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -470,11 +470,15 @@ users).")
(defun doom--reset-custom-dont-initialize-h () (defun doom--reset-custom-dont-initialize-h ()
(setq custom-dont-initialize nil))) (setq custom-dont-initialize nil)))
;; PERF: The mode-line procs a couple dozen times during startup, before the ;; These optimizations are brittle, difficult to debug, and obscure other
;; user even sees the first mode-line. This is normally fast, but we can't ;; issues, so bow out when debug mode is on.
;; predict what the user (or packages) will put into the mode-line. Also, (unless init-file-debug
;; mode-line packages have a bad habit of throwing performance to the ;; PERF: The mode-line procs a couple dozen times during startup, before
;; wind, so best we just disable the mode-line until we can see one. ;; the user even sees the first mode-line. This is normally fast, but we
;; can't predict what the user (or packages) will put into the
;; mode-line. Also, mode-line packages have a bad habit of throwing
;; performance to the wind, so best we just disable the mode-line until
;; we can see one.
(put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format)) (put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format))
(setq-default mode-line-format nil) (setq-default mode-line-format nil)
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
@ -490,7 +494,7 @@ users).")
(setq-default inhibit-redisplay nil (setq-default inhibit-redisplay nil
inhibit-message nil) inhibit-message nil)
(remove-hook 'post-command-hook #'doom--reset-inhibited-vars-h)) (remove-hook 'post-command-hook #'doom--reset-inhibited-vars-h))
(add-hook 'post-command-hook #'doom--reset-inhibited-vars-h -100) (add-hook 'post-command-hook #'doom--reset-inhibited-vars-h -100))
;; PERF: Doom disables the UI elements by default, so that there's less for ;; PERF: Doom disables the UI elements by default, so that there's less for
;; the frame to initialize. However, `tool-bar-setup' is still called and ;; the frame to initialize. However, `tool-bar-setup' is still called and