diff --git a/org-roam-mode.el b/org-roam-mode.el index 8ddc4d9..899c774 100644 --- a/org-roam-mode.el +++ b/org-roam-mode.el @@ -124,11 +124,12 @@ and `:slant'." (defvar org-roam-current-node nil "The current node at point.") -(defcustom org-roam-mode-sections (list #'org-roam-backlinks-section - #'org-roam-reflinks-section) - "List of functions that insert sections for Org-roam." +(defcustom org-roam-mode-section-functions (list #'org-roam-backlinks-section + #'org-roam-reflinks-section) + "Functions which insert sections of the `org-roam-buffer'. +Each function is called with one argument, which is the current org-roam node at point." :group 'org-roam - :type '(repeat function)) + :type 'hook) ;;; The mode (defvar org-roam-mode-map @@ -162,8 +163,7 @@ which visits the thing at point." (org-roam-set-header-line-format (org-roam-node-title org-roam-current-node)) (magit-insert-section (org-roam) (magit-insert-heading) - (dolist (fn org-roam-mode-sections) - (funcall fn org-roam-current-node)))))) + (run-hook-with-args 'org-roam-mode-section-functions org-roam-current-node))))) (defun org-roam-buffer () "Launch an Org-roam buffer for the current node at point."