[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Capture template and elisp expression

From: Štěpán Němec
Subject: [Orgmode] Re: Capture template and elisp expression
Date: Sat, 08 Jan 2011 19:07:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Carsten Dominik <address@hidden> writes:

> On Jan 7, 2011, at 4:00 PM, Štěpán Němec wrote:
>> Carsten Dominik <address@hidden> writes:
>>> On Jan 7, 2011, at 1:08 PM, Štěpán Němec wrote:
>>>> Why aren't the %() expressions simply evaluated in the original buffer
>>>> (if available)? That would solve these issues in a general way. It seems
>>>> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]