I have just started to use org-mode
and I am tweaking an existing configuration to my needs.
In that configuration, the code is itself in an org file and the org-capture-templates
is splited in a lot of individual blocks (because there are some text explanations between) like
(add-to-list 'org-capture-templates
'("j" "Journal entry"
entry
(file+datetree "~/org/journal.org")
"* %?"
:empty-lines 1
))
Given that I have defined my org-directory
to "~/org"
and that this path is duplicated in quite every entry definition, in case I would move the org file in say a share or a git repo, I tried to replace the file paths by a construct like
(add-to-list 'org-capture-templates
'("j" "Journal entry"
entry
(file+datetree (concat org-directory "/journal.org"))
"* %?"
:empty-lines 1
))
Unfortunately when I try to capture a journal entry I get this
org-capture-expand-file: Invalid file location: nil
while (concat org-directory "/journal.org")
evaluates to the same value "~/org/journal.org"
. I suppose that the concat
is missing some quoting, but I did no find the correct form.