summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2013-10-06 17:13:01 -0600
committerEric Schulte <schulte.eric@gmail.com>2013-10-06 17:13:01 -0600
commit8aaf3c9748b6ef8bd5782108ae382f59efef1903 (patch)
treee7a885b82a50175d40607452404661276d444961
parent5afd5d9785aa2b5fa19ff154a74113901c2bcd6e (diff)
downloadorg-mode-8aaf3c9748b6ef8bd5782108ae382f59efef1903.tar.gz
reading tables from lisp code block output
* lisp/ob-lisp.el (org-babel-execute:lisp): Read tabular results written to STDOUT as tables.
-rw-r--r--lisp/ob-lisp.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 68dfacc..0f37653 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -79,7 +79,13 @@ current directory string."
(org-babel-result-cond (cdr (assoc :result-params params))
result
(condition-case nil
- (read (org-babel-lisp-vector-to-list result))
+ (if (member "output" (cdr (assoc :result-params params)))
+ ;; read printed output using normal org table parsing
+ (let ((tmp-file (org-babel-temp-file "lisp-output-")))
+ (with-temp-file tmp-file (insert result))
+ (org-babel-import-elisp-from-file tmp-file))
+ ;; read valued output as lisp
+ (read (org-babel-lisp-vector-to-list result)))
(error result))))
(funcall (if (member "output" (cdr (assoc :result-params params)))
#'car #'cadr)