From 4238c9daacbf9fe8298de69f34166fbe020566a6 Mon Sep 17 00:00:00 2001 From: Chris Barrett Date: Tue, 16 Aug 2022 22:39:51 +1200 Subject: [PATCH] s/advice-add/define-advice --- lisp/org-roam-dblocks.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lisp/org-roam-dblocks.el b/lisp/org-roam-dblocks.el index 5824bed..568960d 100644 --- a/lisp/org-roam-dblocks.el +++ b/lisp/org-roam-dblocks.el @@ -179,7 +179,7 @@ their blocks updated automatically." ;; blindly clear out the block's content. We then check whether the block ;; content needs to be updated. -(defun org-roam-dblocks--prepare-dblock (fn &rest args) +(define-advice org-prepare-dblock (:around (fn &rest args) org-roam-dblocks-dirty-checks) "Advice to hack org's dblock update flow for the dblock types we define. FN is the advised function, and ARGS are its arguments. @@ -221,9 +221,6 @@ and old content." params)))) -(with-eval-after-load 'org - (advice-add 'org-prepare-dblock :around #'org-roam-dblocks--prepare-dblock)) - ;;;###autoload (defun org-roam-dblocks--write-content (params) (when-let* ((new-content (plist-get params :new-content)))