1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-28 07:44:49 +00:00

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.
This commit is contained in:
Dan Davison 2010-10-21 10:25:46 +01:00
parent 35b0d6b1d4
commit db68b1fbf5

View File

@ -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)