emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: Babel: asymptote: erroneous conversion of heterogeneous-typ


From: Nick Dokos
Subject: Re: [O] Bug: Babel: asymptote: erroneous conversion of heterogeneous-typed table
Date: Wed, 31 Aug 2011 04:17:57 -0400

András Major <address@hidden> wrote:

> Hi Eric,
> 
> > Can you post an example?  Here is a working example.
> 
> In your example, simply write "asymptote" in place of "sh" and replace the
> code by "size(100);" just to make sure it's valid asymptote (though the
> error occurs even if you don't).  In fact, I'm quite sure that asy never
> gets executed in this case.
> 

Yes, even without any asymptote code, this breaks. But there seem to be
multiple problems. One is fix-empty-lines, a local routine defines
inside org-babel-asymptote-table-to-array: it seems to assume that the table
is a list of lists, whereas in this case it's a list of strings. The
following patch (which probably is wrong, in that it cures the symptom
rather than the disease):

diff --git a/lisp/ob-asymptote.el b/lisp/ob-asymptote.el
index 89aecb7..39156d2 100644
--- a/lisp/ob-asymptote.el
+++ b/lisp/ob-asymptote.el
@@ -139,7 +139,7 @@ (defun org-babel-asymptote-table-to-array (table type 
params)
                                    (atom-to-string (cdr table))))))
            ;; Remove any empty row
            (fix-empty-lines (table)
-                            (delq nil (mapcar (lambda (l) (delq "" l)) 
table))))
+                            (delq nil (mapcar (lambda (l) (if (listp l) (delq 
"" l) l)) table))))
     (orgtbl-to-generic
      (fix-empty-lines (atom-to-string table))
      (org-combine-plists '(:hline nil :sep "," :tstart "{" :tend "}") 
params))))


lets things go a bit further, but there is mayhem in orgtbl-format-line,
which is called by orgtbl-format-section, which is called by
orgtbl-to-generic above, and I didn't go any further: I just don't know
what the preconditions are on these routines.

Nick



reply via email to

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