From 79ac04f0b1f82fdc10096342307c557de7eb7588 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2019 18:22:57 -0400 Subject: [PATCH] Fix default personal org-capture targets Supposed to resolve to {org-directory}/todo.org, but instead resolved to {default-directory}/todo.org. --- modules/lang/org/+capture.el | 4 +++- modules/lang/org/autoload/org-capture.el | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/lang/org/+capture.el b/modules/lang/org/+capture.el index af5725549..bec8bdf71 100644 --- a/modules/lang/org/+capture.el +++ b/modules/lang/org/+capture.el @@ -21,7 +21,7 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default Is relative to `org-directory' unless it is absolute. Is used in Doom's default `org-capture-templates'.") -(defvaralias '+org-capture-notes-file 'org-default-notes-file +(defvar +org-capture-notes-file "notes.org" "Default target for storing notes. Used as a fall back file for org-capture.el, for templates that do not specify a @@ -30,6 +30,8 @@ target file. Is relative to `org-directory', unless it is absolute. Is used in Doom's default `org-capture-templates'.") +(setq org-default-notes-file (expand-file-name +org-capture-notes-file org-directory)) + ;; ;;; Bootstrap diff --git a/modules/lang/org/autoload/org-capture.el b/modules/lang/org/autoload/org-capture.el index 046a8083f..e11d46d97 100644 --- a/modules/lang/org/autoload/org-capture.el +++ b/modules/lang/org/autoload/org-capture.el @@ -85,6 +85,18 @@ you're done. This can be called from an external shell script." (doom-project-root) (user-error "Couldn't detect a project"))))) +;;;###autoload +(defun +org-capture-todo-file () + "Expand `+org-capture-todo-file' from `org-directory'. +If it is an absolute path return `+org-capture-todo-file' verbatim." + (expand-file-name +org-capture-todo-file org-directory)) + +;;;###autoload +(defun +org-capture-notes-file () + "Expand `+org-capture-notes-file' from `org-directory'. +If it is an absolute path return `+org-capture-todo-file' verbatim." + (expand-file-name +org-capture-notes-file org-directory)) + ;;;###autoload (defun +org-capture-project-todo-file () "Find the nearest `+org-capture-todo-file' in a parent directory, otherwise,