mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-07 14:21:47 -08:00
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).
This commit is contained in:
parent
fef48ab085
commit
1b8ea914de
1 changed files with 14 additions and 22 deletions
36
lisp/doom.el
36
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue