emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Capture with org-directory not working?


From: Nick Dokos
Subject: Re: [O] Capture with org-directory not working?
Date: Tue, 29 Nov 2016 16:05:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]