Function: org-roam-backlinks-section

org-roam-backlinks-section is a byte-compiled function defined in org-roam-mode.el.

Signature

(org-roam-backlinks-section NODE &key (UNIQUE nil) (SHOW-BACKLINK-P nil) (SECTION-HEADING "Backlinks:"))

Documentation

The backlinks section for NODE.

When UNIQUE is nil, show all positions where references are found. When UNIQUE is t, limit to unique sources.

When SHOW-BACKLINK-P is not null, only show backlinks for which this predicate is not nil.

SECTION-HEADING is the string used as a heading for the backlink section.

Source Code

;; Defined in ~/.emacs.d/elpa/org-roam-20260224.1637/org-roam-mode.el
(cl-defun org-roam-backlinks-section (node &key (unique nil) (show-backlink-p nil)
                                           (section-heading "Backlinks:"))
  "The backlinks section for NODE.

When UNIQUE is nil, show all positions where references are found.
When UNIQUE is t, limit to unique sources.

When SHOW-BACKLINK-P is not null, only show backlinks for which
this predicate is not nil.

SECTION-HEADING is the string used as a heading for the backlink section."
  (when-let* ((backlinks (seq-sort #'org-roam-backlinks-sort (org-roam-backlinks-get node :unique unique))))
    (magit-insert-section (org-roam-backlinks)
      (magit-insert-heading section-heading)
      (dolist (backlink backlinks)
        (when (or (null show-backlink-p)
                  (and (not (null show-backlink-p))
                       (funcall show-backlink-p backlink)))
          (org-roam-node-insert-section
           :source-node (org-roam-backlink-source-node backlink)
           :point (org-roam-backlink-point backlink)
           :properties (org-roam-backlink-properties backlink))))
      (insert ?\n))))