From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: evaluation context in call statements Date: Wed, 26 Jun 2013 10:38:57 -0400 Message-ID: <64c8a8451434ab3c4fb5d8e73e9b6848@mail.rickster.com> References: <444ea6cff489e2adc97092bdac881aef@mail.rickster.com> <878v1y574d.fsf@Rainer.invalid> <874ncm55ma.fsf@Rainer.invalid> <87r4fq3ptf.fsf@Rainer.invalid> <87ip11h2zq.fsf@gmail.com> <87fvw5fkpt.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urqs8-0000SK-GV for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 10:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Urqs5-00081J-FE for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 10:39:00 -0400 Received: from [204.62.15.78] (port=42991 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urqs5-00081F-C7 for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 10:38:57 -0400 In-Reply-To: <87fvw5fkpt.fsf@Rainer.invalid> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 2013-06-26 02:29, Achim Gratz wrote: > Eric Schulte writes: > In defense of the existing behavior, I don't see the benefit of calling > a code block with the same arguments from multiple locations and > subsequently littering a file with multiple identical results blocks. > > I agree that this didn't make all that much sense in the past, but with > property evaluation and elisp argument evaluation now anchored to the > point of call, the hierarchical position of the call could and (as the > test case from Rick) will be used to distinguish between invocations > with the same arguments. Since the current way to find the results > doesn't know anything about this, it will generally not do the right > thing anymore. Note that calls using a session had that property all > the time: multiple calls with the same arguments into the same session > are useful, but Babel would only keep the last result. Agreed. The only way to know that the arguments are the "same" is to evaluated them :). > My only thought about a :target header argument is that it would need > to > be implemented for other types of code blocks as well, which could lead > to very confusing behavior if we have a named code block with a :target > header argument which differs from the name. > > Oh yes, the specification of that would be interesting. I'll try to > see > how this "beam the result anywhere" functionality sprang into existence > and what the intended use case was (I expect something to do with > sessions). I believe the ability to replace named results anywhere was added by Nicolas in commit 2f2a80fe (quick look at ob-core w/ vc-annotate). > My current suggestion is however to limit the results block search to > the same subtree and stop searching at later #+CALL and #+BEGIN_SRC > line. We could make this conditional on a :[no]clobber argument to > keep > compatibility with the current behaviour (clobbering the first result > would be the current and perhaps default behaviour). These search bounds make sense, but i think this should be the default behavior. I don't see the current behavior as making sense---at least to me. At the time (late 2012) I found Nicolases changes (named results blocks, attributes and captions on the results block and not the source, etc) confusing. I still find it odd that you need to evaluate a source block before you can e.g, add a caption or attributes to the results (previous behavior was that header arguments on the source block were used for the results in exporting.) Also, i think a new value for :replace ("original"?) would make more sense than a new :clobber option. > My vote is for adding #+name support to call lines, and then handling > their results in the same manner as code block results. > > I'm not sure what this would entail other than replacing the call with > its arguments with the name of the call in the results line. But yes, > that'd be a step forward, although you'd have to be careful when > copying > calls. It seems inconsistent to add #+name support to call lines but not the other block modifiers (#+header :var ..., etc). I think call lines are a special case, so would be ok with the new :target option. rick