Function: org-roam-id-find

org-roam-id-find is a byte-compiled function defined in org-roam-id.el.

Signature

(org-roam-id-find ID &optional MARKERP)

Documentation

Return the location of the entry with the id ID using the Org-roam db.

The return value is a cons cell (file-name . position), or nil if there is no entry with that ID. With optional argument MARKERP, return the position as a new marker.

Source Code

;; Defined in ~/.emacs.d/elpa/org-roam-20260224.1637/org-roam-id.el
(defun org-roam-id-find (id &optional markerp)
  "Return the location of the entry with the id ID using the Org-roam db.
The return value is a cons cell (file-name . position), or nil
if there is no entry with that ID.
With optional argument MARKERP, return the position as a new marker."
  (cond
   ((symbolp id) (setq id (symbol-name id)))
   ((numberp id) (setq id (number-to-string id))))
  (let ((node (org-roam-populate (org-roam-node-create :id id))))
    (when-let* ((file (org-roam-node-file node)))
      (if markerp
          (let ((buffer (or (find-buffer-visiting file)
                            (find-file-noselect file))))
            (with-current-buffer buffer
              (move-marker (make-marker) (org-roam-node-point node) buffer)))
        (cons (org-roam-node-file node)
              (org-roam-node-point node))))))