From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [bug] cannot extract just one column of table for use in gnuplot src block Date: Sun, 23 Mar 2014 18:51:30 +0100 Message-ID: <87bnwwst0d.fsf@Rainer.invalid> References: <871txs2a3o.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRmYo-0000Vq-7S for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 13:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRmYi-0000HF-15 for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 13:51:50 -0400 Received: from plane.gmane.org ([80.91.229.3]:48022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRmYh-0000H6-Q0 for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 13:51:43 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WRmYg-0007Wt-A7 for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 18:51:42 +0100 Received: from pd9eb3d94.dip0.t-ipconnect.de ([217.235.61.148]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Mar 2014 18:51:42 +0100 Received: from Stromeko by pd9eb3d94.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Mar 2014 18:51:42 +0100 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 Eric S Fraga writes: > The trace shows that the column has been extracted exactly as I > wish. No, the column has been extracted as a vector, not a table. > However, it would appear that the function may expect a sequence > and not just a single element? A table line is a list or a symbol, at the point of the error only a list may be present. However, due to "data" being a vector, you'll get a number. That's easy enough to guard for in that function, but the bug is much further up the call chain, most likely in org-babel-gnuplot-process-vars. Something along the line of the following patch might be in order: diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el index 6783706..7d7db2a 100644 --- a/lisp/ob-gnuplot.el +++ b/lisp/ob-gnuplot.el @@ -85,10 +85,15 @@ (defun org-babel-gnuplot-process-vars (params) (lambda (pair) (cons (car pair) ;; variable name - (if (listp (cdr pair)) ;; variable value - (org-babel-gnuplot-table-to-data - (cdr pair) (org-babel-temp-file "gnuplot-") params) - (cdr pair)))) + (let* ((val (cdr pair)) ;; variable value + (lp (listp val))) + (if lp + (org-babel-gnuplot-table-to-data + (let* ((first (car val)) + (tablep (or (listp first) (symbolp first)))) + (if tablep val (mapcar 'list val))) + (org-babel-temp-file "gnuplot-") params) + val)))) (mapcar #'cdr (org-babel-get-header params :var))))) Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf Blofeld V1.15B11: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada