Consider the following org mode document:
#+NAME: source
#+BEGIN_SRC python :cache yes
import random
return random.randint(3, 300)
#+END_SRC
#+RESULTS[2314024a531aeb3c9e51cd69e45adf654927e9fa]: source
: 5
#+NAME: source2
#+BEGIN_SRC python :cache yes
import random
return random.randint(5, 4000)
#+END_SRC
#+NAME: test
#+BEGIN_SRC sh :var v=source :var v2=source2
echo "$v$v2"
#+END_SRC
#+RESULTS: test
: 5777
If you execute test
repeatedly as is, 5777
will change each time, just always starting with a 5. This is because source
has a result block, and it is cached. source2
does not have a result block, so it is not cached.
If I explicitly then execute source2
, it will then have a result block and will be cached, so the output of test
will always be the same.
Is there a way to configure either org mode globally or my source block(s) to produce a #+RESULT
block even when they are called indirectly, as from executing test
in this example?