|
From: | Alexander Vorobiev |
Subject: | Re: [O] Capture with org-directory not working? |
Date: | Tue, 29 Nov 2016 23:15:14 -0600 |
Alexander Vorobiev <address@hidden> writes:
> I have recently started having this issue with my capture templates. In my case I want to ask the user
> (me) which file should be used to store the note, so I have a bunch of templates like this
>
> (setq org-capture-templates
> '(("o" "Project todo" entry (file+headline (av/choose-agenda-file) "Tasks") ))
>
> where av/choose-agenda-file uses completing-read to ask the user to choose a file from a list it
> constructs on the fly. This approach has worked for years and now it results in the "invalid file
> location" message. The backquote does not help because the function needs to be called at run time, not
> when the variable is defined.
>
IIUC, you cannot use arbitrary sexps, but you *can* use
("o" "Project todo" entry (file+headline (lambda () (av/choose-agenda-file)) "Tasks"))
Other plausible forms (e.g. (function av/choose-agenda-file) or (quote av/choose-agenda-file) )
run afoul of the abritrary sexp exception and do not work AFAICS.
--
Nick
[Prev in Thread] | Current Thread | [Next in Thread] |