From ad5fca5440e5c8a6b8078013684df43b3e43d773 Mon Sep 17 00:00:00 2001 From: N V <44036031+progfolio@users.noreply.github.com> Date: Sun, 10 May 2020 17:17:55 -0400 Subject: [PATCH] "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 0807252d64230840faaa8687fee8399a08e3f8b4. Co-authored-by: Leo Vivier --- org-roam-macs.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org-roam-macs.el b/org-roam-macs.el index 2d8088f..1f58e5a 100644 --- a/org-roam-macs.el +++ b/org-roam-macs.el @@ -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)