emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* babel result chain outdated/inconsistent using var
@ 2016-04-06 12:01 Daniele Pizzolli
  2016-04-06 12:54 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Daniele Pizzolli @ 2016-04-06 12:01 UTC (permalink / raw)
  To: Org-mode

Hello,

is possible to update the “#+RESULTS: pid” when the block “#+NAME:
echo-pid” is evaluated in the following snippet?

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”.  Using the cache does not make sense: the process is
generating different output every time.

The info at “M-: (info "(org) Specific header arguments")” does not
mention something useful.

* Intro

** pid

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

The following result is usually outdated/inconsistent!

#+RESULTS: pid
: 25272

** echo pid

#+NAME: echo-pid
#+BEGIN_SRC shell :var DATA=pid :results value
printf '%s' "${DATA}"
#+END_SRC

#+RESULTS: echo-pid
: 25273

The code block in pid is evaluated every time, but the results are
used only to populate the pid variable and non for updating the
results in the buffer:

#+BEGIN_EXAMPLE
executing Shell code block (pid)...
Wrote /tmp/babel-4889iZN/ob-input-4889CyZ
"25273"
executing Shell code block (echo-pid)...
Wrote /tmp/babel-4889iZN/ob-input-48892ay
Code block evaluation complete.
#+END_EXAMPLE

This was tested with Org-mode version 8.3.4 release_8.3.4-705-g716e33.

Thanks in advance for your suggestions,
Daniele

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-07 11:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).