In emacs org-babel, can I export the results of previous executions instead of re-evaluating on export?

EHN

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?

Jonathan Leech-Pepin

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  

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I export an evernote account into Emacs.org?

How can I export * as namespace in Babel?

Can I use Babel to transpile to ES5 but keep import/export instead of commonjs?

emacs org-babel results unexpected output

Emacs org-mode export markdown

emacs org-mode \label in html export

Export org agenda views periodically in Emacs

How can I export the results of a C# unit test?

How to export html from emacs org-mode that can be opened in Microsoft Word

Export to Excel results in length of strings instead of data

How can i export this Powershell export to a file

Can I export an object using `export` as "`module.export`"

emacs org export HTML: custom paragraph vs list margins

emacs ORG-mode "headless" export-as commands?

Emacs org-mode - Export to html without syntax highlighting

Emacs org does not evaluate source blocks at export anymore (version 8.3.2)

Emacs org-mode markdown export: #+TITLE option not exported

babel 7 Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead

Can I "export" functions in bash?

Can"t export test results (Resharper 2017.2)

Can you 'export' output results in python?

MariaDB is returning undefined once I export the results

Re-export a default export

Can't require() default export value in Babel 6.x

Can't require() default export value in Babel 6.x

Re-apply table formulas on org-mode export

How can I convert from default export to normal export in typescript

How can I have my code run through different excel files and export unique files of results in R?

Can I export Firestore data to a local file path instead of a Cloud Storage path?