Function: denote-org-capture

denote-org-capture is an autoloaded and byte-compiled function defined in denote.el.

Signature

(denote-org-capture)

Documentation

Create new note through org-capture-templates.

Use this as a function that returns the path to the new file. The file is populated with Denote's front matter. It can then be expanded with the usual specifiers or strings that org-capture-templates supports.

This function obeys denote-prompts, but it ignores file-type, if present: it always sets the Org file extension for the created note to ensure that the capture process works as intended, especially for the desired output of the denote-org-capture-specifiers (which can include arbitrary text).

Consult the manual for template samples.

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;;;###autoload
(defun denote-org-capture ()
  "Create new note through `org-capture-templates'.
Use this as a function that returns the path to the new file.
The file is populated with Denote's front matter.  It can then be
expanded with the usual specifiers or strings that
`org-capture-templates' supports.

This function obeys `denote-prompts', but it ignores `file-type',
if present: it always sets the Org file extension for the created
note to ensure that the capture process works as intended,
especially for the desired output of the
`denote-org-capture-specifiers' (which can include arbitrary
text).

Consult the manual for template samples."
  (pcase-let* ((denote-prompts (remove 'file-type denote-prompts)) ; Do not prompt for file-type. We use org.
               (`(,title ,keywords _ ,directory ,date ,identifier ,template ,signature)
                (denote--creation-get-note-data-from-prompts))
               (`(,title ,keywords _ ,directory ,date ,identifier ,template ,signature)
                (denote--creation-prepare-note-data title keywords 'org directory date identifier template signature))
               (front-matter (denote--format-front-matter title date keywords identifier signature 'org))
               (template-string (cond ((stringp template) template)
                                      ((functionp template) (funcall template))
                                      (t (user-error "Invalid template")))))
    (setq denote-last-path
          (denote-format-file-name directory identifier keywords title ".org" signature))
    (when (file-regular-p denote-last-path)
      (user-error "A file named `%s' already exists" denote-last-path))
    (denote--keywords-add-to-history keywords)
    (concat front-matter template-string denote-org-capture-specifiers)))