summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2010-12-20 18:20:48 +0000
committerDan Davison <dandavison7@gmail.com>2010-12-21 14:19:24 +0000
commit70349cd0c27c9993688bd47748806eafb8db204f (patch)
tree26653203cd1270f34668f309ad8aa7cc62cb2d19
parente0b79276789e47c268ac9a3dcc9b9bac93c1f251 (diff)
downloadorg-mode-70349cd0c27c9993688bd47748806eafb8db204f.tar.gz
ob: Bug fix in writing results to file
* lisp/ob.el (org-babel-execute-src-block): Avoid calling `orgtbl-to-generic' on number results
-rw-r--r--lisp/ob.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 0b3f775..6b2276c 100644
--- a/lisp/ob.el
+++ b/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)