mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-10 00:31:22 -07: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.
|
;; Ensure the CLI framework is ready.
|
||||||
(require 'doom-cli)
|
(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.
|
;; HACK: bin/doom suppresses site-lisp to silence otherwise the
|
||||||
;; Why? To suppress the otherwise unavoidable output they commonly produce
|
;; unavoidable output it produces (like deprecation notices,
|
||||||
;; (like deprecation notices, file-loaded messages, and linter warnings).
|
;; file-loaded messages, and linter warnings). This output can confuse
|
||||||
;; This output pollutes Emacs' log and the output of doom's CLI (or
|
;; or alarm consumers Doom-derived CLIs, and are rarely important or
|
||||||
;; scripts derived from it) with potentially confusing or alarming -- but
|
;; actionable for the end-user. Turn on debug mode if you actually
|
||||||
;; always unimportant and rarely actionable -- information to the user. To
|
;; want to see it!
|
||||||
;; see that output, turn on debug mode!
|
(quiet!!
|
||||||
(let ((site-loader
|
(require 'cl nil t) ; "Package cl is deprecated"
|
||||||
(lambda ()
|
(unless site-run-file
|
||||||
(quiet!!
|
(when-let* ((site-file (get 'site-run-file 'initial-value)))
|
||||||
(unless interactive?
|
(let ((inhibit-startup-screen inhibit-startup-screen))
|
||||||
(require 'cl nil t)) ; "Package cl is deprecated"
|
(setq site-run-file site-file)
|
||||||
(unless site-run-file
|
(load site-run-file t)))))))
|
||||||
(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)))
|
|
||||||
|
|
||||||
;; A last ditch opportunity to undo hacks or do extra configuration before
|
;; A last ditch opportunity to undo hacks or do extra configuration before
|
||||||
;; the session is complicated by user config and packages.
|
;; the session is complicated by user config and packages.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue