Function: org-roam-capture--prepare-buffer

org-roam-capture--prepare-buffer is a byte-compiled function defined in org-roam-capture.el.

Signature

(org-roam-capture--prepare-buffer)

Documentation

Prepare the capture buffer for the current Org-roam based capture template.

This function will initialize and setup the capture buffer, position the point to the current :target (and if necessary, create it if it doesn't exist), and place the point for further processing by org-capture.

Note: During the capture process this function is run by org-capture-set-target-location, as a (function ...) based capture target.

Source Code

;; Defined in ~/.emacs.d/elpa/org-roam-20260224.1637/org-roam-capture.el
;;;; Capture target
(defun org-roam-capture--prepare-buffer ()
  "Prepare the capture buffer for the current Org-roam based capture template.
This function will initialize and setup the capture buffer,
position the point to the current :target (and if necessary,
create it if it doesn't exist), and place the point for further
processing by `org-capture'.

Note: During the capture process this function is run by
`org-capture-set-target-location', as a (function ...) based
capture target."
  (let ((id (cond ((run-hook-with-args-until-success 'org-roam-capture-preface-hook))
                  (t (org-roam-capture--setup-target-location)))))
    (org-roam-capture--adjust-point-for-capture-type)
    (let ((template (org-capture-get :template)))
      (when (stringp template)
        (org-capture-put
         :template
         (org-roam-capture--fill-template template))))
    (org-roam-capture--put :id id)
    (org-roam-capture--put :finalize (or (org-capture-get :finalize)
                                         (org-roam-capture--get :finalize)))))