bin/doom: polish output

Reduces the amount of "noise" included in bin/doom's output.

Also fixes an issue where warnings during autoloads generation would
sneak into Doom's autoloads file, producing weird void-variable errors,
like

  (void-variable . rainbow-delimiters:)
  (void-variable . diredfl:)
  (void-variable . company:)
This commit is contained in:
Henrik Lissner 2021-05-23 21:40:01 -04:00
parent 54067455e7
commit 4b5cf7d46f
4 changed files with 45 additions and 37 deletions

View file

@ -106,7 +106,9 @@ Accepts 'ansi and 'text-properties. nil means don't render colors.")
;;;###autoload
(defun doom--print (output)
(unless (string-empty-p output)
(princ output)
(if noninteractive
(send-string-to-terminal output)
(princ output))
(terpri)
output))
@ -254,12 +256,12 @@ DEST can be one or more of `standard-output', a buffer, a file"
(insert-char out))
(send-string-to-terminal (char-to-string out)))))
(letf! (defun message (msg &rest args)
(with-current-buffer log-buffer
(print-group!
(insert (doom--format (apply #'format msg args)) "\n")))
(if doom-debug-p
(doom--print (doom--format (apply #'format msg args)))
(apply message msg args)))
(print-group!
(with-current-buffer log-buffer
(insert (doom--format (apply #'format msg args)) "\n"))
(when (or doom-debug-p (not inhibit-message))
(doom--print (doom--format (apply #'format msg args)))))
message)
(unwind-protect
,(macroexp-progn body)
(with-current-buffer log-buffer