From 0f556345fdfdc4e5bcc6bb023877bf9a0f203dae Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 Nov 2024 05:46:42 -0500 Subject: [PATCH] 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) --- lisp/doom.el | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lisp/doom.el b/lisp/doom.el index 71ab4fd15..22e9b7996 100644 --- a/lisp/doom.el +++ b/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