babel: clojure: use shell-command-on-region

This commit is contained in:
Dan Davison 2010-03-03 21:59:32 +00:00
parent a8c1a49b77
commit 54c7b04734
1 changed files with 5 additions and 7 deletions

View File

@ -230,13 +230,11 @@ or nil if \"none\" is specified"
'replace)
(buffer-string)))
(value
(let ((tmp-src-file (make-temp-file "clojure_babel_input_"))
(tmp-results-file (make-temp-file "clojure_babel_results_")))
(with-temp-file tmp-src-file
(insert (format org-babel-clojure-wrapper-method body tmp-results-file tmp-results-file)))
(shell-command
(format "%s %s" (mapconcat #'identity (org-babel-clojure-babel-clojure-cmd) " ")
tmp-src-file))
(let ((tmp-results-file (make-temp-file "clojure_babel_results_")))
(with-temp-buffer
(insert (format org-babel-clojure-wrapper-method body tmp-results-file tmp-results-file))
(shell-command-on-region (point-min) (point-max)
(mapconcat #'identity (org-babel-clojure-babel-clojure-cmd) " ")))
(org-babel-clojure-table-or-string
(with-temp-buffer (insert-file-contents tmp-results-file) (buffer-string))))))))