From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Luis_Mu=F1iz?= Subject: Babel-tables: need to enable language to pass tables to code blocks Date: Sat, 18 Aug 2012 15:13:38 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ir7-0000Lt-C1 for emacs-orgmode@gnu.org; Sat, 18 Aug 2012 09:14:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2ir6-000409-2T for emacs-orgmode@gnu.org; Sat, 18 Aug 2012 09:14:21 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:54498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ir5-000402-ST for emacs-orgmode@gnu.org; Sat, 18 Aug 2012 09:14:19 -0400 Received: by weys10 with SMTP id s10so3457168wey.0 for ; Sat, 18 Aug 2012 06:14:19 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi! I've started using tables to provide data to my babel-embedded scripts, and I've found some issues. The first one is that table data is embedded in tangled scripts only if the source language has been enabled for evaluation. That is, given a sample table: #+TBLNAME: sample-table | n | 2**n | 3**n | |---+------+------| | 1 | 2 | 3 | | 2 | 4 | 9 | ...the next block is supposed to create a file with the table in it when tangled, but it doesn't... #+BEGIN_SRC sh :var data=3Dsample-table :tangle yes : #+END_SRC ... unless =3Dsh=3D has been enabled for evaluation (by default, only =3Demacs-lisp=3D is). One can simply overcome this by first evaluating this block [fn:1]: #+NAME: sh-activate #+BEGIN_SRC emacs-lisp :results silent (org-babel-do-load-languages 'org-babel-load-languages '((sh . t)) ) #+END_SRC While this is not a serious problem it took me by surprise; I don't know if it *really* has to be fixed (I'm unsure if this is a bug or a feature ;) but, at least, it should appear in the documentation; may I suggest here, under the `table' heading? I'm using org-mode version 7.8.11 from the GIT repository (updated yesterday release_7.8.11-505-g952d72), and Emacs 23.2.1. TIA, -- - Luis Mu=F1iz [fn:1] BTW, I've found a simpler way to achieve the same results by using file variables: #+ -*- mode: org; eval: (let () (org-babel-goto-named-src-block "sh-activate") (org-babel-execute-src-block) (org-babel-tangle)) -*-