[O] Babel-tables: Column-width formatting strings should be discarded while tangling

2012-08-18 Thread Luis Muñiz
Given the following table and source block:
#+TBLNAME: sample-table
| n |   2**n |   3**n |
|---++|
|   5 |   10 |   10 |
| 1 |  2 |  3 |
| 2 |  4 |  9 |

#+BEGIN_SRC emacs-lisp :var data=sample-table :tangle yes
  ()
#+END_SRC

After tangling the code block, the formatting strings are there.  Okay,
the a 
href=http://orgmode.org/org.html#Column-width-and-alignment;documentation/a
clearly states that /Lines which only contain these formatting cookies
will be removed automatically when exporting the document/, and I've
*tangled*, not *exported*.  But, should not the same happen when tangling?
Moreover, it is done with a
href=http://orgmode.org/org.html#hlines;horizontal lines/a,
a href=http://orgmode.org/org.html#colnames;column names/a,
and a href=http://orgmode.org/org.html#rownames;row names/a.

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.  I have
tested with some of the other formatting strings (alignment, l, c
and r) with the same results.

TIA,
--
  - Luis Muñiz



[O] Babel-tables: need to enable language to pass tables to code blocks

2012-08-18 Thread Luis Muñiz
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 a href=http://orgmode.org/org.html#Languages;evaluation/a.

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=sample-table :tangle yes
  :
#+END_SRC

... unless =sh= has been enabled for evaluation (by default, only
=emacs-lisp= 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 a href=http://orgmode.org/org.html#var;here/a, 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ñiz

[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)) -*-



[O] Can't tangle inline source code

2012-08-17 Thread Luis Muñiz
Hi there!  I'm having some problems while tangling.  More
specifically, I can tangle a src block of code:
#+BEGIN_SRC emacs-lisp :tangle block.el :results silent
  (format-time-string %Y/%m_%b/%d_%a :: [%H:%M:%S]
  )
#+END_SRC

But I can't tangle the inlined equivalent form:
  src_emacs-lisp[ :tangle inline.el :results silent
]{(format-time-string %Y/%m_%b/%d_%a :: [%H:%M:%S])}

I'm using org-mode version 7.8.11 from the GIT repository (updated a
couple hours ago, release_7.8.11-505-g952d72), and Emacs 23.2.1.
Same results using shell code (sh), and/or with Org Version 7.4.

In order to repeat the test, simply paste this whole message in an
Emacs (org-)buffer and tangle (C-c C-v t) it.  It should generate two
files block.el and inline.el, but only the former appears.

Regards,
--
  - Luis Muñiz