From 1b8ea914de5b1ce8e1a699b5859032e5a1dc4804 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 13 Feb 2026 20:16:49 -0500 Subject: [PATCH] fix: only defer site-lisp in non-interactive sessions And no-op on Emacs 31, which has changed startup order such that site-lisp is loaded *before* early-init (and is therefore out of our hands). --- lisp/doom.el | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/lisp/doom.el b/lisp/doom.el index 2cfc8ebd2..0a416ea40 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -859,29 +859,21 @@ appropriately against `noninteractive' or the `cli' context." ;; Ensure the CLI framework is ready. (require 'doom-cli) - (add-hook 'doom-cli-initialize-hook #'doom-finalize))) + (add-hook 'doom-cli-initialize-hook #'doom-finalize) - ;; HACK: I suppress loading of site files here to load them manually later. - ;; Why? To suppress the otherwise unavoidable output they commonly produce - ;; (like deprecation notices, file-loaded messages, and linter warnings). - ;; This output pollutes Emacs' log and the output of doom's CLI (or - ;; scripts derived from it) with potentially confusing or alarming -- but - ;; always unimportant and rarely actionable -- information to the user. To - ;; see that output, turn on debug mode! - (let ((site-loader - (lambda () - (quiet!! - (unless interactive? - (require 'cl nil t)) ; "Package cl is deprecated" - (unless site-run-file - (when-let* ((site-file (get 'site-run-file 'initial-value))) - (let ((inhibit-startup-screen inhibit-startup-screen)) - (setq site-run-file site-file) - (load site-run-file t)))))))) - (if interactive? - (define-advice startup--load-user-init-file (:before (&rest _) load-site-files 100) - (funcall site-loader)) - (funcall site-loader))) + ;; HACK: bin/doom suppresses site-lisp to silence otherwise the + ;; unavoidable output it produces (like deprecation notices, + ;; file-loaded messages, and linter warnings). This output can confuse + ;; or alarm consumers Doom-derived CLIs, and are rarely important or + ;; actionable for the end-user. Turn on debug mode if you actually + ;; want to see it! + (quiet!! + (require 'cl nil t) ; "Package cl is deprecated" + (unless site-run-file + (when-let* ((site-file (get 'site-run-file 'initial-value))) + (let ((inhibit-startup-screen inhibit-startup-screen)) + (setq site-run-file site-file) + (load site-run-file t))))))) ;; A last ditch opportunity to undo hacks or do extra configuration before ;; the session is complicated by user config and packages.