emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniele Pizzolli <dan@toel.it>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: babel result chain outdated/inconsistent using var
Date: Wed, 06 Apr 2016 15:27:46 +0200	[thread overview]
Message-ID: <877fgazzzzsw8d@me.localhost.invalid> (raw)
In-Reply-To: <87zit6c2y6.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 06 Apr 2016 14:54:41 +0200")

On Wed, Apr 06 2016, Nicolas Goaziou wrote:

> Hello,
>
> Daniele Pizzolli <dan@toel.it> writes:
>
>> is possible to update the “#+RESULTS: pid” when the block “#+NAME:
>> echo-pid” is evaluated in the following snippet?
>
> Without `org-babel-execute-buffer', I don't think so.

Hello,

Thanks Nicolas for the reply.  Ok, but `org-babel-execute-buffer'
produces an inconsistent document right now.

>> This will lead to a consistent document generation with “M-x
>> org-babel-execute-buffer” or by hitting “C-c C-c” on “#+NAME:
>> echo-pid”.
>
> I'm not convinced that this behaviour should be enforced. If I C-c C-c
> on a block, I expect only the results of the block to be updated, not
> some other part of the document I am editing.

Mmm, the same reasoning can be used for arguing about the current
behaviour: If I C-c C-c on a block, I expect only the code of the
block to be executed, not some other part of the document I am
editing.  This behaviour will fix my issue.

I agree that neither case should be enforced, but the user should be
in charge to choose.  A reasonable default behaviour will be to not
re-execute the other code block if the previous result is already
present.

> Also, what if the other block is in another document? I don't think it
> should be updated either.

But should it be either executed?

> What is the harm in using `org-babel-execute-buffer' for your use case?

Right now it does not produce a consistent document, that should be
desirable.

I do not have a strong preference about the solution (reuse without
re-execute, or update the other result) but for sure, right now there
is no way to produce a consistent document.

I tried for a workaround, adding `:eval query'

#+NAME: pid
#+BEGIN_SRC shell :results value :cache no :eval query
printf '%s' "${$}"
#+END_SRC

and then discarding the execution, but instead of reusing the actual
result it pass `nil'... no luck.

Thanks again,
Daniele

  reply	other threads:[~2016-04-06 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 12:01 babel result chain outdated/inconsistent using var Daniele Pizzolli
2016-04-06 12:54 ` Nicolas Goaziou
2016-04-06 13:27   ` Daniele Pizzolli [this message]
2016-04-06 19:27     ` Nicolas Goaziou
2016-04-07  8:12       ` Daniele Pizzolli
2016-04-07  8:50         ` Nicolas Goaziou
2016-04-07  9:22           ` Daniele Pizzolli
2016-04-07  9:50             ` Nicolas Goaziou
2016-04-07 11:16               ` Daniele Pizzolli

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=877fgazzzzsw8d@me.localhost.invalid \
    --to=dan@toel.it \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).