Use delay-warning instead of message in warn! macro

This commit is contained in:
Henrik Lissner 2018-02-14 00:51:20 -05:00
parent 0b9ac52d27
commit f6039eaee3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -82,14 +82,11 @@ interactive session."
;;;###autoload ;;;###autoload
(defmacro warn! (message &rest args) (defmacro warn! (message &rest args)
"Output a colored warning for the current module in the *Messages* buffer." "Output a colored warning for the current module in the *Messages* buffer."
(let ((msg (format "WARNING: %s" (format message args)))) (if (file-in-directory-p load-file-name doom-modules-dir)
(if (file-in-directory-p load-file-name doom-modules-dir) `(cl-destructuring-bind (cat . mod) (doom-module-from-path ,load-file-name)
`(cl-destructuring-bind (cat . mod) (doom-module-from-path load-file-name) (delay-warning (format "%s %s" cat mod) (format ,message ,@args) :warning))
(message `(delay-warning (file-relative-name load-file-name doom-emacs-dir)
"%s" (format ,message ,@args) :warning)))
(propertize (format "%s %s" (list cat mod) ,msg)
'face 'warning)))
`(message "%s" (propertize ,msg 'face 'warning)))))
;;;###autoload ;;;###autoload
(defmacro log! (message &rest args) (defmacro log! (message &rest args)