From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: evaluation context in call statements Date: Wed, 26 Jun 2013 09:06:22 -0600 Message-ID: <87k3lgewrv.fsf@gmail.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: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrrKN-0004fV-Lb for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:08:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrrKH-0002PF-BB for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:08:11 -0400 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:34989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrrKH-0002Ox-4q for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:08:05 -0400 Received: by mail-pa0-f45.google.com with SMTP id bi5so14310983pad.32 for ; Wed, 26 Jun 2013 08:08:04 -0700 (PDT) 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: Achim Gratz Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain >> My vote is for adding #+name support to call lines, and then handling >> their results in the same manner as code block results. Achim Gratz writes: > 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. > This could work exactly as named source blocks work. E.g., --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=named-calls.org Unnamed code block. #+begin_src emacs-lisp 'bar #+end_src #+RESULTS: : bar Named code block. #+name: foo-block #+begin_src emacs-lisp 'foo #+end_src can have text between itself and its results #+RESULTS: foo-block : foo Unnamed call line. #+call: foo-block() #+RESULTS: foo-block() : foo Named call line. #+name: foo-call #+call: foo-block() Can have text between itself and its results. #+RESULTS: foo-call : foo --=-=-= Content-Type: text/plain Rick Frankel writes: > 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. See above. This is not inconsistent, it is equivalent with how names and code block already work, which means it is less for new users to learn and old users to keep track of. Also, the existing code block results handling has not caused much confusion, and seems to be powerful enough to deal with every use case. Achim Gratz and Rick Frankel write: >> 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. I agree that the current behavior is confusing, but I don't like this suggestion. I expect people will be mystified when calls replace results in the same subtree and don't replace blocks elsewhere in the same Org-mode file. No other parts of Org-mode's code block support work this way. > 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.) > I think this behavior works well and I don't think it will change. I see how it could be nice to automatically apply attributes (e.g., captions, labels etc...) of a code block to that blocks results, but then what if I want to export the code block body and not the results, what if I want to export both. I think Nicolas was right to unify, simplify and clarify the Org-mode attribute semantics. Thanks for the feedback. -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--