(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:
Jethro Kuan
2020-05-10 16:44:28 +08:00
committed by GitHub
parent d68d1f8ebb
commit 3efe315ff1
4 changed files with 21 additions and 13 deletions

View File

@ -44,6 +44,7 @@
;; Library Requires
(require 'cl-lib)
(require 'org)
(require 'org-roam-macs)
(require 'org-element)
(declare-function org-roam-insert "org-roam")
@ -51,6 +52,8 @@
(declare-function org-roam--list-all-files "org-roam")
(declare-function org-roam--org-roam-file-p "org-roam")
(defvar org-roam-verbose)
(cl-defstruct (org-roam-doctor-checker (:copier nil))
(name 'missing-checker-name)
(description "")
@ -118,7 +121,7 @@ CHECKERS is the list of checkers used."
(defun org-roam-doctor--skip ()
"Skip the current error."
(message "Skipping..."))
(org-roam-message "Skipping..."))
(defun org-roam-doctor--replace-link ()
"Replace the current link with a new link."
@ -218,7 +221,7 @@ If CHECKALL, run the check only for all Org-roam files."
(unless (memq buf existing-buffers)
(save-buffer buf)
(kill-buffer buf))))))
(message "Linting completed."))
(org-roam-message "Linting completed."))
(provide 'org-roam-doctor)