fix: remove custom-dont-initialize hack

It seems either Emacs' warning library and/or debugger relies on
custom.el functionality at load time to properly function. If
`custom-dont-initialize` is non-nil when a warning or error occurs,
Emacs fails to fully load the `warning` or `backtrace` libraries,
causing this error to obscure the true warning/error with:

  Error in delayed-warnings-hook (display-delayed-warnings): (void-variable
  warning-minimum-log-level)
This commit is contained in:
Henrik Lissner
2024-11-06 05:46:42 -05:00
parent 48d043301e
commit 0f556345fd

View File

@ -481,21 +481,6 @@ users).")
(setq load-suffixes (get 'load-suffixes 'initial-value)
load-file-rep-suffixes (get 'load-file-rep-suffixes 'initial-value))))
;; PERF: Doom uses `defcustom' merely to announce variables that users may
;; reconfigure. Trouble is it fires off initializers meant to accommodate
;; any user attempts to configure them *before* they are defined, which
;; isn't possible since the user's first opportunity to modify them comes
;; long after they're defined (in $DOOMDIR/init.el), so this is
;; unnecessary work. To spare Emacs the startup time, I disable this
;; behavior until $DOOMDIR is loaded.
(setq custom-dont-initialize t)
(add-hook! 'doom-before-init-hook
(defun doom--reset-custom-dont-initialize-h ()
(setq custom-dont-initialize nil)))
(define-advice command-line-1 (:around (fn args-left) respect-defcustom-setters)
(let ((custom-dont-initialize nil))
(funcall fn args-left)))
;; These optimizations are brittle, difficult to debug, and obscure other
;; issues, so bow out when debug mode is on.
(unless init-file-debug