Просмотр исходного кода

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.
Dan Davison 14 лет назад
Родитель
Сommit
db68b1fbf5
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      lisp/ob-sh.el

+ 2 - 1
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)