From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Filippo A. Salustri" Subject: Re: Re: question about capture templates Date: Wed, 23 Feb 2011 12:28:25 -0500 Message-ID: References: <80ei71o17z.fsf@missioncriticalit.com> <87k4gtpcvp.fsf@berkeley.edu> <80bp255935.fsf@missioncriticalit.com> <0973A1B4-5892-4685-A2F6-D34C66ECAB67@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0219596589==" Return-path: Received: from [140.186.70.92] (port=35770 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsIVp-000721-BN for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 12:28:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsIVn-0007z5-N7 for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 12:28:29 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:56558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsIVn-0007yr-CI for emacs-orgmode@gnu.org; Wed, 23 Feb 2011 12:28:27 -0500 Received: by wwb29 with SMTP id 29so711834wwb.30 for ; Wed, 23 Feb 2011 09:28:26 -0800 (PST) In-Reply-To: <0973A1B4-5892-4685-A2F6-D34C66ECAB67@gmail.com> 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: Carsten Dominik Cc: =?ISO-8859-1?Q?S=E9bastien_Vauban?= , emacs-orgmode@gnu.org --===============0219596589== Content-Type: multipart/alternative; boundary=0016e64c1c4ea452e0049cf66cf0 --0016e64c1c4ea452e0049cf66cf0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yup; I just tried the git snapshot of 23 Feb and it's working. Thanks!! Cheers. Fil On 22 February 2011 04:15, Carsten Dominik wrote= : > > 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. > > > > Very frustrating. org-capture clearly has the original buffer handy (f= or > %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 > > > > > Cheers. > > Fil > > > > 2011/2/21 S=E9bastien Vauban > > Hi Richard, > > > > 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 captur= ed > 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 cod= e > to > > >> execute, instead of data. See Emacs manual. > > > > > > I'm not sure that backquotes will do what the OP wants. Backquotes wi= ll > > > 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. > > > > You're definitely right. I missed the distinction "at Org launch time" = vs > "at > > execution time"... Pull my answer off the records ;-) > > > > Best regards, > > Seb > > > > -- > > S=E9bastien Vauban > > > > > > _______________________________________________ > > 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 > > > > > > > > -- > > 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/ > > _______________________________________________ > > 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 > > > > --=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/ --0016e64c1c4ea452e0049cf66cf0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yup; I just tried the git snapshot of 23 Feb and it's working.
Than= ks!!
Cheers.
Fil

On 22 February 2011 04:15, Carsten Dominik <carsten.dominik@gmail.com> wrote:

On Feb 22, 2011, at 1:39 AM, Filippo A. Salustri wrote:

> Thanks to everyone for the varied and thoughtful responses. =A0I didn&= #39;t think of backquotes, but I know about them from Scheme, and no, they = shouldn't work in this case.
>
> Very frustrating. =A0org-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. =A0Hmmm. =A0I'll think some more. =A0If= 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. =A0So your original attempt

>> ("m" "Message" entry (file+datetree (buffer-fi= le-name
>> (buffer-base-buffer))) "* MSG @ %U %?\n %a")

should now work.

Hope this helps

- Carsten

>
> Cheers.
> Fil
>
> 2011/2/21 S=E9bastien Vauban <wxhgmqzgwmuf@spammotel.com>
> Hi Richard,
>
> Richard Lawrence wrote:
> > S=E9bastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
> >> "Filippo A. Salustri" wrote:
> >>> I would really like to be able to vary the file into whic= h 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. Backq= uotes will
> > allow the OP to compute the value of a target file at the time th= e (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.
>
> You're definitely right. I missed the distinction "at Org lau= nch time" vs "at
> execution time"... Pull my answer off the records ;-)
>
> Best regards,
> =A0Seb
>
> --
> S=E9bastien Vauban
>
>
> _______________________________________________
> 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
>
>
>
> --
> 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<= br> > http://de= seng.ryerson.ca/~fil/
> _______________________________________________
> 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






--
Filippo A. Salus= tri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson Univ= ersity
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5= 000 ext 7749
Fax: 416/979-5265
Email: salustri= @ryerson.ca
http://deseng= .ryerson.ca/~fil/
--0016e64c1c4ea452e0049cf66cf0-- --===============0219596589== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0219596589==--