Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an org-mode document with a number of code blocks. Some of these take a long time to run, so I don't want to re-evaluate them each time I do an export.

I know I can prevent the re-evaluation by setting org-export-babel-evaluate to nil, but when I do this it won't print out the results of previous evaluations either, even if I have the code block "results" option set to "output".

Yes, I know I can remove the "#+results:" line from before the results block by hand, but this gets annoying whenever I need to reevaluate by hand, for example when I make a code change.

So, how can I get it to export the old results rather than re-evaluating each time?

share|improve this question
up vote 3 down vote accepted

You want to set your header argument to include :exports both or :exports results.

For example (The differences in time are due to evaluation when creating the headlines with C-c C-c, I left them as such to make sure there was no further evaluation):

* Testing - results
#+name: test
#+begin_src sh :exports results
  uptime
#+end_src

#+RESULTS:
| 15:49:23 up  2:00 | 2 users | load average: 0.00 | 0.0 | 0.0 |
* Testing - both
#+name: test
#+begin_src sh :exports both
  uptime
#+end_src

#+RESULTS:
| 15:50:02 up  2:01 | 2 users | load average: 0.00 | 0.0 | 0.0 |

Produces the following ASCII C-c C-e A

1 Testing - results 
--------------------


  15:49:23 up  2:00   2 users   load average: 0.00   0.0   0.0  

2 Testing - both 
-----------------


  uptime

  15:50:02 up  2:01   2 users   load average: 0.00   0.0   0.0  
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .