From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Capture with org-directory not working? Date: Tue, 29 Nov 2016 16:05:52 -0500 Message-ID: <87lgw2ro7j.fsf@gmail.com> References: <87vaxr51t3.fsf@gmail.com> <87zin2ty3f.fsf@alphapapa.net> <87vaxqts75.fsf@alphapapa.net> <9E0BD070-F074-4524-8204-8CD840CDFE8C@gmail.com> <87fuotsc7b.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBpbL-0000R4-Lb for emacs-orgmode@gnu.org; Tue, 29 Nov 2016 16:06:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBpbI-0004df-FN for emacs-orgmode@gnu.org; Tue, 29 Nov 2016 16:06:07 -0500 Received: from [195.159.176.226] (port=48908 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBpbI-0004dO-8U for emacs-orgmode@gnu.org; Tue, 29 Nov 2016 16:06:04 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cBpb9-0008J0-O0 for emacs-orgmode@gnu.org; Tue, 29 Nov 2016 22:05:55 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Alexander Vorobiev 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