s/advice-add/define-advice

This commit is contained in:
Chris Barrett
2022-08-16 22:39:51 +12:00
parent 47f45cf06f
commit 4238c9daac

View File

@ -179,7 +179,7 @@ their blocks updated automatically."
;; blindly clear out the block's content. We then check whether the block ;; blindly clear out the block's content. We then check whether the block
;; content needs to be updated. ;; 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. "Advice to hack org's dblock update flow for the dblock types we define.
FN is the advised function, and ARGS are its arguments. FN is the advised function, and ARGS are its arguments.
@ -221,9 +221,6 @@ and old content."
params)))) params))))
(with-eval-after-load 'org
(advice-add 'org-prepare-dblock :around #'org-roam-dblocks--prepare-dblock))
;;;###autoload ;;;###autoload
(defun org-roam-dblocks--write-content (params) (defun org-roam-dblocks--write-content (params)
(when-let* ((new-content (plist-get params :new-content))) (when-let* ((new-content (plist-get params :new-content)))