@@ -514,19 +514,25 @@ Sorts by title."
514514 (string< (org-roam-node-title (org-roam-backlink-source-node a))
515515 (org-roam-node-title (org-roam-backlink-source-node b))))
516516
517- (cl-defun org-roam-backlinks-section (node &key (unique nil ))
517+ (cl-defun org-roam-backlinks-section (node &key (unique nil ) (show-backlink-p nil ) )
518518 " The backlinks section for NODE.
519519
520520When UNIQUE is nil, show all positions where references are found.
521- When UNIQUE is t, limit to unique sources."
521+ When UNIQUE is t, limit to unique sources.
522+
523+ When SHOW-BACKLINK-P is not null, only show backlinks for which
524+ this predicate is not nil."
522525 (when-let ((backlinks (seq-sort #'org-roam-backlinks-sort (org-roam-backlinks-get node :unique unique))))
523526 (magit-insert-section (org-roam-backlinks)
524527 (magit-insert-heading " Backlinks:" )
525528 (dolist (backlink backlinks)
526- (org-roam-node-insert-section
527- :source-node (org-roam-backlink-source-node backlink)
528- :point (org-roam-backlink-point backlink)
529- :properties (org-roam-backlink-properties backlink)))
529+ (when (or (null show-backlink-p)
530+ (and (not (null show-backlink-p))
531+ (funcall show-backlink-p backlink)))
532+ (org-roam-node-insert-section
533+ :source-node (org-roam-backlink-source-node backlink)
534+ :point (org-roam-backlink-point backlink)
535+ :properties (org-roam-backlink-properties backlink))))
530536 (insert ?\n ))))
531537
532538; ;;; Reflinks
0 commit comments