fix: shut up site-lisp
One various OSes, Emacs ships with site-lisp files that load OS/architecture-specific config (like native-comp config), or load-lines for Emacs packages installed via your OS package manager (like mu4e). Output from these are rarely suppressed, for some reason, which causes noise in *Messages* at startup, which triggers a redraw, which can be very expensive during startup, depending on your window system.
This commit is contained in:
parent
5e7c769315
commit
1d9b102181
1 changed files with 14 additions and 0 deletions
14
lisp/doom.el
14
lisp/doom.el
|
@ -489,10 +489,24 @@ users).")
|
||||||
inhibit-message nil)
|
inhibit-message nil)
|
||||||
(redraw-frame))
|
(redraw-frame))
|
||||||
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
|
||||||
|
|
||||||
|
;; PERF,UX: An annoying aspect of site-lisp files is that they're often
|
||||||
|
;; noisy (they emit load messages or other output to stdout). These
|
||||||
|
;; queue unnecessary redraws at startup, cost startup time, and pollute
|
||||||
|
;; the logs. I get around it by suppressing it until we can load it
|
||||||
|
;; manually, later (in the `startup--load-user-init-file' advice below).
|
||||||
|
(put 'site-run-file 'initial-value site-run-file)
|
||||||
|
(setq site-run-file nil)
|
||||||
|
|
||||||
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-inhibit-vars)
|
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-inhibit-vars)
|
||||||
(let (--init--)
|
(let (--init--)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
|
(when (setq site-run-file (get 'site-run-file 'initial-value))
|
||||||
|
(let ((inhibit-startup-screen inhibit-startup-screen))
|
||||||
|
(letf! (defun load (file &optional noerror _nomessage &rest args)
|
||||||
|
(apply load file noerror t args))
|
||||||
|
(load site-run-file t t))))
|
||||||
(apply fn args)
|
(apply fn args)
|
||||||
(setq --init-- t))
|
(setq --init-- t))
|
||||||
(when (or (not --init--) init-file-had-error)
|
(when (or (not --init--) init-file-had-error)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue