From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: Capture template and elisp expression Date: Sat, 08 Jan 2011 19:07:53 +0100 Message-ID: <87ei8n5kw6.fsf@gmail.com> References: <4D25B0BE.3040408@gmail.com> <23766.1294352789@gamaville.americas.hpqcorp.net> <87mxnc6hnf.fsf@gmail.com> <87ipy069os.fsf@gmail.com> <5DF061FC-7815-4952-964A-973928399A12@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=48393 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbdFG-0002MJ-8X for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 13:10:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbdFA-0004FS-Sf for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 13:10:30 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:36121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbdFA-0004FK-Nw for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 13:10:24 -0500 Received: by bwz16 with SMTP id 16so20756953bwz.0 for ; Sat, 08 Jan 2011 10:10:19 -0800 (PST) In-Reply-To: <5DF061FC-7815-4952-964A-973928399A12@gmail.com> (Carsten Dominik's message of "Sat, 8 Jan 2011 18:58:55 +0100") 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: nicholas.dokos@hp.com, emacs-orgmode , Rainer M Krug Carsten Dominik writes: > On Jan 7, 2011, at 4:00 PM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: > >> Carsten Dominik writes: >> >>> On Jan 7, 2011, at 1:08 PM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: >>>> Why aren't the %() expressions simply evaluated in the original buffer >>>> (if available)? That would solve these issues in a general way. It see= ms >>>> to me that there is no advantage to evaluating the expressions in the >>>> temporary capture buffer, but I'm not familiar with the code so I might >>>> be missing something. Is there a reason for that? >>> >>> The sexp can be used to insert stuff into the template, so I think it >>> is correct to evaluate it in the template buffer. >> >> I don't understand this argument. Of course the _result_ of the >> evaluation is inserted into the template, but why is it useful to >> evaluate the expression itself in the context of the template buffer? Is >> it likely that one would be interested in some information only >> available in the template buffer? To me it seems that the much more >> likely case is the one of Rainer -- i.e. the need to access variable >> bindings from the original buffer (buffer name, mode, other local >> variables etc.). > > > Such a function is allowed to do anything. It might search around > in the template, change things, whatever. So I don't think it > should be evaluated in a different buffer. OK, thank you for the explanation. One can always do (with-current-buffer (org-capture-get :original-buffer) ...) should the need arise. =C5=A0t=C4=9Bp=C3=A1n