Преглед на файлове

ob: Bug fix in writing results to file

* lisp/ob.el (org-babel-execute-src-block): Avoid calling
`orgtbl-to-generic' on number results
Dan Davison преди 14 години
родител
ревизия
70349cd0c2
променени са 1 файла, в които са добавени 10 реда и са изтрити 6 реда
  1. 10 6
      lisp/ob.el

+ 10 - 6
lisp/ob.el

@@ -417,12 +417,16 @@ block."
 		  (when (cdr (assoc :file params))
 		    (when result
 		      (with-temp-file (cdr (assoc :file params))
-			(if (stringp result)
-			    (insert result)
-			  (insert (orgtbl-to-generic
-				   result
-				   (list :sep (or (cdr (assoc :sep params)) "\t")
-					 :fmt 'echo-res))))))
+			(insert
+			 (if (listp result)
+			     ;; table result
+			     (orgtbl-to-generic
+			      result
+			      (list
+			       :sep (or (cdr (assoc :sep (nth 2 info))) "\t")
+			       :fmt 'echo-res))
+			   ;; scalar result
+			   (echo-res result)))))
 		    (setq result (cdr (assoc :file params)))))
 		(org-babel-insert-result
 		 result result-params info new-hash indent lang)