From e89adba685dfe6dad4e67438930945fec8d311a3 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 25 Mar 2014 18:55:13 +0100 Subject: [PATCH] ob-gnuplot: create a proper table even when handed just a vector MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): `org-babel-gnuplot-table-to-data´ expects a table, so we need to construct one when Babel hands us a vector. Thanks to Eric Fraga for reporting the bug. http://permalink.gmane.org/gmane.emacs.orgmode/84072 --- lisp/ob-gnuplot.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el index 8767e88e4..ffe5dcf59 100644 --- a/lisp/ob-gnuplot.el +++ b/lisp/ob-gnuplot.el @@ -85,10 +85,15 @@ code." (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))))) (defun org-babel-expand-body:gnuplot (body params) -- 2.11.4.GIT