mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
15
lisp/doom.el
15
lisp/doom.el
@ -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
|
||||
|
Reference in New Issue
Block a user