From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bug: Babel: asymptote: erroneous conversion of heterogeneous-typed table Date: Wed, 31 Aug 2011 04:17:57 -0400 Message-ID: <10851.1314778677@alphaville.dokosmarshall.org> References: <20110829080003.GA12790@discus> <87hb50li4b.fsf@gmail.com> <878vqclf64.fsf@gmail.com> <87mxesjs9e.fsf@gmail.com> <87fwkkjhvt.fsf@gmail.com> <87y5yc6tx4.fsf@gmail.com> <87vctgi0ve.fsf@gmail.com> <87hb506qqk.fsf@gmail.com> <878vqc6nye.fsf@gmail.com> <87ei0266dw.fsf@gmail.com> <878vqa62lo.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyfzl-00044Z-ET for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 04:18:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qyfzj-0005Ga-TG for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 04:18:01 -0400 Received: from g4t0017.houston.hp.com ([15.201.24.20]:31474 helo=g1u1820.austin.hp.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyfzj-0005Cl-Mj for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 04:17:59 -0400 In-Reply-To: Message from =?us-ascii?Q?=3D=3Futf-8=3Fb=3FQW5kcsOhcw=3D=3D?= =?us-ascii?Q?=3F=3D?= Major of "Wed\, 31 Aug 2011 06\:48\:11 -0000." 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: =?us-ascii?Q?=3D=3Futf-8=3Fb=3FQW5kcsOhcw=3D=3D=3F=3D?= Major Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Andr=C3=A1s Major wrote: > Hi Eric, >=20 > > Can you post an example? Here is a working example. >=20 > 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. >=20 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 p= arams) (atom-to-string (cdr table)))))) ;; Remove any empty row (fix-empty-lines (table) - (delq nil (mapcar (lambda (l) (delq "" l)) tab= le)))) + (delq nil (mapcar (lambda (l) (if (listp l) (d= elq "" l) l)) table)))) (orgtbl-to-generic (fix-empty-lines (atom-to-string table)) (org-combine-plists '(:hline nil :sep "," :tstart "{" :tend "}") para= ms)))) 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