emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: doltes
Subject: Get =#+RESULTS= without re-evaluating source code block?
Date: Wed, 27 Jan 2021 17:14:43 -0500
User-agent: mu4e 1.4.14; emacs 27.1

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]