branch: externals/denote commit 6227df012f787fb9bd46fdf72b243ce31bc91b40 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Make org-capture always set .org extension --- README.org | 5 +++++ denote-org-capture.el | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 7ee2f45241..13331c3e41 100644 --- a/README.org +++ b/README.org @@ -224,6 +224,11 @@ in the template. Instead, they have to be assigned to the user option (setq denote-org-capture-specifiers "%l\n%i\n%?") #+end_src +Note that ~denote-org-capture~ ignores the ~denote-file-type~: 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~. + * Front matter :PROPERTIES: :CUSTOM_ID: h:13218826-56a5-482a-9b91-5b6de4f14261 diff --git a/denote-org-capture.el b/denote-org-capture.el index 4f3b2d5501..ba3c22e624 100644 --- a/denote-org-capture.el +++ b/denote-org-capture.el @@ -46,6 +46,11 @@ ;; :immediate-finish nil ;; :kill-buffer t ;; :jump-to-captured t))) +;; +;; Note that `denote-org-capture' ignores the `denote-file-type': 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'. ;;; Code: @@ -73,10 +78,15 @@ 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. -Search the source code of this function for a comment with a -sample template. We will eventually have a manual." +Note that this function ignores the `denote-file-type': 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'. + +Consult the manual for template samples." (let ((title (denote--title-prompt)) - (keywords (denote--keywords-prompt))) + (keywords (denote--keywords-prompt)) + (denote-file-type nil)) ; we enforce the .org extension for `org-capture' (denote--path title keywords) (denote--prepare-note denote-last-title denote-last-keywords denote-last-path) (denote--keywords-add-to-history denote-last-keywords)