emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Get =#+RESULTS= without re-evaluating source code block?
@ 2021-01-27 22:14 doltes
  2021-01-27 22:38 ` tomas
  0 siblings, 1 reply; 7+ messages in thread
From: doltes @ 2021-01-27 22:14 UTC (permalink / raw)
  To: emacs-orgmode

Get =#+RESULTS= without re-evaluating source code block?

Let's suppose I have a code block which requires a long time to finish

#+NAME: big-computation
#+begin_src bash
sleep 5 # Some computation which requires a long time to complete.
echo a
#+end_src

#+RESULTS: big-computation
#+begin_example
a
#+end_example

I want to use the results of that code block in other code blocks so I
use a =noweb= reference (see below.)

#+begin_src bash :noweb yes
printf "%s\n" <<big-computation()>>
#+end_src

#+RESULTS:
#+begin_example
a

#+end_example

However, doing this (i.e. using a =noweb= reference) would make the
command to be evaluated whenever getting its results. I don't want
this, I want the =:noweb= reference to actually use the already
computed results.

So, my question is: Is it possible to use the actual =#+RESULTS= code
block instead of always evaluating it when referencing the results
through a =:noweb= reference?

-- 
Greetings,
doltes.


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

end of thread, other threads:[~2021-02-02 20:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 22:14 Get =#+RESULTS= without re-evaluating source code block? doltes
2021-01-27 22:38 ` tomas
2021-01-27 23:31   ` John Kitchin
2021-01-28  3:26     ` Greg Minshall
2021-02-02  2:10       ` John Kitchin
2021-02-02 20:02         ` Nick Dokos
2021-01-27 23:33   ` doltes

Code repositories for project(s) associated with this 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).