"Refactor org-roam-message as a function" (#595)

* Refactor org-roam-message as a function

Add to commentary that org-roam-macs may contain other utility
functions (similar to org-macs).

* Fix typos

* Try again

* Fix typo

* fix syntax error

* fix syntax error

* Apply args correctly

* Refactor with funcall

* Revert "Refactor with funcall"

This reverts commit 0807252d64.

Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
This commit is contained in:
N V
2020-05-10 17:17:55 -04:00
committed by GitHub
parent 3efe315ff1
commit ad5fca5440

View File

@ -27,7 +27,8 @@
;;; Commentary:
;;
;; This library implements macros used throughout org-roam
;; This library implements macros and utility functions used throughout
;; org-roam.
;;
;;
;;; Code:
@ -58,11 +59,10 @@ 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)))
(defun org-roam-message (format-string &rest args)
"Pass FORMAT-STRING and ARGS to `message' when `org-roam-verbose' is t."
(when org-roam-verbose
(apply #'message `(,(concat "(org-roam) " format-string) ,@args))))
(provide 'org-roam-macs)