From 109917c589d7ccee33532adc953661a9e5fcc2d4 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer <44036031+progfolio@users.noreply.github.com> Date: Sun, 2 May 2021 04:35:36 -0400 Subject: [PATCH] org-roam-mode-sections: Convert to abnormal hook (#1504) See: #1503 --- org-roam-mode.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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."