refactor: remove unused core variables

doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
This commit is contained in:
Henrik Lissner 2022-06-24 21:15:31 +02:00
parent 74cc541597
commit 14b2395424
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
22 changed files with 55 additions and 76 deletions

View file

@ -264,20 +264,20 @@ NAME, ARGLIST, and BODY are the same as `defun', `defun*', `defmacro', and
This silences calls to `message', `load', `write-region' and anything that
writes to `standard-output'. In interactive sessions this inhibits output to the
echo-area, but not to *Messages*."
`(if doom-debug-p
`(if init-file-debug
(progn ,@forms)
,(if doom-interactive-p
`(let ((inhibit-message t)
(save-silently t))
(prog1 ,@forms (message "")))
`(letf! ((standard-output (lambda (&rest _)))
(defun message (&rest _))
(defun load (file &optional noerror nomessage nosuffix must-suffix)
(funcall load file noerror t nosuffix must-suffix))
(defun write-region (start end filename &optional append visit lockname mustbenew)
(unless visit (setq visit 'no-message))
(funcall write-region start end filename append visit lockname mustbenew)))
,@forms))))
,(if noninteractive
`(letf! ((standard-output (lambda (&rest _)))
(defun message (&rest _))
(defun load (file &optional noerror nomessage nosuffix must-suffix)
(funcall load file noerror t nosuffix must-suffix))
(defun write-region (start end filename &optional append visit lockname mustbenew)
(unless visit (setq visit 'no-message))
(funcall write-region start end filename append visit lockname mustbenew)))
,@forms)
`(let ((inhibit-message t)
(save-silently t))
(prog1 ,@forms (message ""))))))
(defmacro eval-if! (cond then &rest body)
"Expands to THEN if COND is non-nil, to BODY otherwise.