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: Alexander Vorobiev
Subject: Re: [O] Capture with org-directory not working?
Date: Tue, 29 Nov 2016 23:15:14 -0600

The workaround with lambda worked, thanks a lot! As I mentioned I didn't have any problems with the templates in years but they stopped working after a recent update.

Alex

On Tue, Nov 29, 2016 at 3:05 PM, Nick Dokos <address@hidden> wrote:
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]