emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-babel order of evaluation
Date: Thu, 12 Jan 2012 18:07:41 -0700	[thread overview]
Message-ID: <87ipkgqu8w.fsf@gmx.com> (raw)
In-Reply-To: 20120112225129.GA26670@BigDog.local

[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]

Rick Frankel <rick@rickster.com> writes:

> On Thu, Jan 12, 2012 at 04:35:31PM -0600, Leo Alekseyev wrote:
>> >> Therefore, when executing an entire buffer, there is no way to have
>> >> the execution of a call block dependent on the prior execution of a
>> >> source block.
>> >>
>> >
>> > It would be better to make the dependency explicit by passing the
>> > results of the call line as a (potentially unused) variable to the code
>> > block.  For example;
>> [snip]
>
> The problem w/ this is that the (potentially time consuming) dependent
> will be executed twice when doing a buffer eval.
>
>> > There is (at least currently) no guarantee that evaluation order will be
>> > buffer order.
>> 
>> Is there some deep rationale for the current behavior that I'm not
>> seeing?  Are there big obstacles to enforcing ligeral execution order?
>
> It's because prior to 7.8, call blocks were not executed during a
> buffer execute. The solution was to execute all the call blocks after
> executing the src block. (Eric would have to comment on how hard it
> would be to merge the two functions :).
>

Turns out it was not that difficult to change this behavior.  You and
Leo are both correct that in-buffer-order evaluation is more natural and
expected than the previous behavior.  I've just pushed up a fix after
which evaluating the following


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: execute-in-order.org --]
[-- Type: text/x-org, Size: 211 bytes --]

#+Title: Execute all executables in Order
#+Property: results silent

#+name: foo
#+BEGIN_SRC sh :var it="one"
  echo $it >> debug
#+END_SRC

#+call: foo("two")

#+BEGIN_SRC sh
  echo "three" >> debug
#+END_SRC

[-- Attachment #3: Type: text/plain, Size: 196 bytes --]


results in the creation of a "debug" file in the same directory reading;

,----
| one
| two
| three
`----

Thanks for bringing this up,

>
> rick
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

  reply	other threads:[~2012-01-13  1:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  0:25 org-babel order of evaluation Rick Frankel
2012-01-12 14:43 ` Eric Schulte
2012-01-12 22:35   ` Leo Alekseyev
2012-01-12 22:51     ` Rick Frankel
2012-01-13  1:07       ` Eric Schulte [this message]
2012-01-13  1:52         ` Rick Frankel
2012-01-20 17:58           ` Leo Alekseyev
2012-01-23 17:56             ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipkgqu8w.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).