mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(internal): add org-roam-message
(#593)
This macro simplifies message printing, so we can respect `org-roam-verbose` in more places. Also silences more messages when `org-roam-verbose` set to false.
This commit is contained in:
@ -33,6 +33,8 @@
|
||||
;;; Code:
|
||||
;;;; Library Requires
|
||||
|
||||
(defvar org-roam-verbose)
|
||||
|
||||
(defmacro org-roam--with-temp-buffer (&rest body)
|
||||
"Execute BODY within a temp buffer.
|
||||
Like `with-temp-buffer', but propagates `org-roam-directory'."
|
||||
@ -56,7 +58,11 @@ to look.
|
||||
(error-message-string err)
|
||||
,templates))))
|
||||
|
||||
|
||||
(defmacro org-roam-message (format-string &rest args)
|
||||
"Message MSG with ARGS when `org-roam-verbose' is true."
|
||||
(declare (indent 0) (debug t))
|
||||
`(when org-roam-verbose
|
||||
(message (concat "(org-roam) " ,format-string) ,@args)))
|
||||
|
||||
(provide 'org-roam-macs)
|
||||
|
||||
|
Reference in New Issue
Block a user