emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] [babel] New handling of file output


From: Dan Davison
Subject: [Orgmode] [babel] New handling of file output
Date: Tue, 21 Dec 2010 16:02:39 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

Please note the following changes to the way that org-babel handles
file output. These may break existing org-babel files which use
the :file header argument.

:file <filename> should be understood as saying "write the result
to <filename> and return a link to <filename>".

This works for all languages. For graphics languages (e.g. ditaa, dot,
gnuplot) there is no change in behavior: "result" in the above is the
graphics, and a link to the image is placed in the org buffer. For
general-purpose languages (e.g. emacs-lisp, python, R, ruby, shell),
the "result" written to file is the normal org-babel result (string,
number, table).

This is a backwards-incompatible change for R, which was previously
interpreting :file to mean "send graphics to file". I will send a
separate email concerning R.

In order to return a file link from a src block without telling babel
to save any results to that file, use :results <filename> and do not
use :file. The code block can of course write arbitrary content to
<filename>.

Some examples:

Save the output of ls -l as a .csv file (recall that :results value is
the default):

#+begin_src sh :file dirlisting.csv :sep ,
 ls -l
#+end_src

Send the text output of ls -l directly to file:

#+begin_src sh :results output :file dirlisting.txt
 ls -l
#+end_src

Dan




reply via email to

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