From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: question about capture templates Date: Tue, 22 Feb 2011 10:15:15 +0100 Message-ID: <0973A1B4-5892-4685-A2F6-D34C66ECAB67@gmail.com> References: <80ei71o17z.fsf@missioncriticalit.com> <87k4gtpcvp.fsf@berkeley.edu> <80bp255935.fsf@missioncriticalit.com> Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=55832 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ProL3-0004bS-8P for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 04:15:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ProL1-0003Vs-Vd for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 04:15:21 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:64228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ProL1-0003Vg-Q7 for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 04:15:19 -0500 Received: by wwb17 with SMTP id 17so7176626wwb.30 for ; Tue, 22 Feb 2011 01:15:18 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Filippo A. Salustri" Cc: =?iso-8859-1?Q?S=E9bastien_Vauban?= , emacs-orgmode@gnu.org On Feb 22, 2011, at 1:39 AM, Filippo A. Salustri wrote: > Thanks to everyone for the varied and thoughtful responses. I didn't = think of backquotes, but I know about them from Scheme, and no, they = shouldn't work in this case. >=20 > Very frustrating. org-capture clearly has the original buffer handy = (for %a stuff) yet I can't get it out of there without hacking the org = code, which I am loathe to do. Hmmm. I'll think some more. If I come = up with anything; I'll report it. I have just implemented that whenever you mean a file name in capture templates, you can instead give a function, a variable, or a lisp form. So your original attempt >> ("m" "Message" entry (file+datetree (buffer-file-name >> (buffer-base-buffer))) "* MSG @ %U %?\n %a") should now work. Hope this helps - Carsten >=20 > Cheers. > Fil >=20 > 2011/2/21 S=E9bastien Vauban > Hi Richard, >=20 > Richard Lawrence wrote: > > S=E9bastien Vauban writes: > >> "Filippo A. Salustri" wrote: > >>> I would really like to be able to vary the file into which a = captured item > >>> goes. Specifically, I'd like to insert the item into whatever file = I was > >>> visiting when I started the capture. > > > >> You have to use backquotes so that expressions are considered as = code to > >> execute, instead of data. See Emacs manual. > > > > I'm not sure that backquotes will do what the OP wants. Backquotes = will > > allow the OP to compute the value of a target file at the time the = (setq > > org-capture templates ...) form is evaluated. The OP needs a way to > > determine the target file at the time of capture (right?), not at = the time > > the variable is set. >=20 > You're definitely right. I missed the distinction "at Org launch time" = vs "at > execution time"... Pull my answer off the records ;-) >=20 > Best regards, > Seb >=20 > -- > S=E9bastien Vauban >=20 >=20 > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >=20 >=20 >=20 > --=20 > Filippo A. Salustri, Ph.D., P.Eng. > Mechanical and Industrial Engineering > Ryerson University > 350 Victoria St, Toronto, ON > M5B 2K3, Canada > Tel: 416/979-5000 ext 7749 > Fax: 416/979-5265 > Email: salustri@ryerson.ca > http://deseng.ryerson.ca/~fil/=20 > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten