From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: [babel] New handling of file output Date: Tue, 21 Dec 2010 16:02:39 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=55478 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PV4fy-0007DW-QA for emacs-orgmode@gnu.org; Tue, 21 Dec 2010 11:02:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PV4fx-0006fa-IZ for emacs-orgmode@gnu.org; Tue, 21 Dec 2010 11:02:58 -0500 Received: from lo.gmane.org ([80.91.229.12]:51230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PV4fx-0006dW-9j for emacs-orgmode@gnu.org; Tue, 21 Dec 2010 11:02:57 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PV4fv-0007wy-3c for emacs-orgmode@gnu.org; Tue, 21 Dec 2010 17:02:55 +0100 Received: from 94.196.196.169.threembb.co.uk ([94.196.196.169]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Dec 2010 17:02:55 +0100 Received: from dandavison7 by 94.196.196.169.threembb.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Dec 2010 17:02:55 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 should be understood as saying "write the result to and return a link to ". 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 and do not use :file. The code block can of course write arbitrary content to . 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