emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: =?utf-8?b?QW5kcsOhcw==?= Major <andras.g.major@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Bug: Babel: asymptote:	erroneous conversion of heterogeneous-typed table
Date: Wed, 31 Aug 2011 04:17:57 -0400	[thread overview]
Message-ID: <10851.1314778677@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from =?utf-8?b?QW5kcsOhcw==?= Major <andras.g.major@gmail.com> of "Wed\, 31 Aug 2011 06\:48\:11 -0000." <loom.20110831T084526-16@post.gmane.org>

András Major <andras.g.major@gmail.com> 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	other threads:[~2011-08-31  8:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29  8:00 Bug: Babel: asymptote: erroneous conversion of heterogeneous-typed table Major A
2011-08-29  8:47 ` Nicolas Goaziou
2011-08-29  9:12   ` András Major
2011-08-29  9:50     ` Nicolas Goaziou
2011-08-29 10:42       ` András Major
2011-08-29 12:50         ` Nicolas Goaziou
2011-08-29 16:35           ` Nicolas Goaziou
2011-08-29 16:52             ` Eric Schulte
2011-08-29 17:27               ` Nicolas Goaziou
2011-08-29 18:02                 ` Eric Schulte
2011-08-29 18:50                   ` András Major
2011-08-29 19:02                     ` Eric Schulte
2011-08-29 19:11                       ` Nick Dokos
2011-08-30 19:12                       ` András Major
2011-08-30 19:34                         ` Eric Schulte
2011-08-30 20:45                           ` András Major
2011-08-30 20:55                             ` Eric Schulte
2011-08-31  6:48                               ` András Major
2011-08-31  8:17                                 ` Nick Dokos [this message]
2011-08-31  9:35                                   ` Nicolas Goaziou
2011-08-31 12:14                                     ` Eric Schulte
2011-08-29  9:05 ` Nick Dokos
2011-08-29  9:40   ` András Major

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10851.1314778677@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=andras.g.major@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).