summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-10-21 10:25:46 +0100
committerDan Davison <davison@stats.ox.ac.uk>2010-10-21 13:06:56 +0100
commitdb68b1fbf5827496b91651308fb3e5766283dfa5 (patch)
tree6583bdbc8d61c45a66e8ffed54f8802ed22bbe92
parent35b0d6b1d4a0bdaa87fb61422e8c04692b3ec6cb (diff)
downloadorg-mode-db68b1fbf5827496b91651308fb3e5766283dfa5.tar.gz
babel: Handle non-nested list values in shell
* ob-sh.el (org-babel-sh-var-to-sh): Ensure value has the structure of an Org-mode table (list of lists) Non-nested lists can arise either by explicit assignment, e.g. :var '(1 2), or by assigning a one-dimensional slice of a table.
-rw-r--r--lisp/ob-sh.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/ob-sh.el b/lisp/ob-sh.el
index 153579f..107d1c4 100644
--- a/lisp/ob-sh.el
+++ b/lisp/ob-sh.el
@@ -102,7 +102,8 @@ var of the same value."
(org-babel-sh-var-to-sh el sep))))
(format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
(orgtbl-to-generic
- (deep-string var) (list :sep (or sep "\t")))))
+ (deep-string (if (listp (car var)) var (list var)))
+ (list :sep (or sep "\t")))))
(if (stringp var)
(if (string-match "[\n\r]" var)
(format "$(cat <<BABEL_STRING\n%s\nBABEL_STRING\n)" var)