The Complete Computing Environment

Extracting Org Roam Headings


Call this function cce/org-roam-extract within an org-mode heading to extract that text to a new org-roam buffer. It uses the title as a default and inserts a link to the buffer on completion using the org-roam capture systems

(defun cce/org-roam-extract ()
  "extract heading under point to a new org-roam file"
  (let ((title (elt (org-heading-components) 4)))
    (kill-region (mark) (point))
    (insert "- ")
    (org-roam-insert nil (list title))
    (goto-char (point-min))
(provide 'cce/org-roam-extract)