mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
reading tables from lisp code block output
* lisp/ob-lisp.el (org-babel-execute:lisp): Read tabular results written to STDOUT as tables.
This commit is contained in:
parent
5afd5d9785
commit
8aaf3c9748
@ -79,7 +79,13 @@ current directory string."
|
|||||||
(org-babel-result-cond (cdr (assoc :result-params params))
|
(org-babel-result-cond (cdr (assoc :result-params params))
|
||||||
result
|
result
|
||||||
(condition-case nil
|
(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))))
|
(error result))))
|
||||||
(funcall (if (member "output" (cdr (assoc :result-params params)))
|
(funcall (if (member "output" (cdr (assoc :result-params params)))
|
||||||
#'car #'cadr)
|
#'car #'cadr)
|
||||||
|
Loading…
Reference in New Issue
Block a user