diff options
author | Bastien Guerry <bzg@altern.org> | 2011-07-16 15:07:23 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-07-16 15:07:23 +0200 |
commit | 4c714198b4140b62ca679b358824113f7311e3c9 (patch) | |
tree | 8a863388c6799c52045f4173f20a115911b247d1 | |
parent | 920cf53e686daea4f406aa237b48fe2ef4730426 (diff) | |
download | org-mode-4c714198b4140b62ca679b358824113f7311e3c9.tar.gz |
ob-clojure.el: cosmetic reformatting of a defun.
-rw-r--r-- | lisp/ob-clojure.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index a72b14c..bb99bae 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -62,16 +62,16 @@ vars "\n ") "]\n" body ")") body)))) - (if (or (member "code" result-params) - (member "pp" result-params)) - (format - (concat - "(let [org-mode-print-catcher (java.io.StringWriter.)] " - "(clojure.pprint/with-pprint-dispatch clojure.pprint/%s-dispatch " - "(clojure.pprint/pprint (do %s) org-mode-print-catcher) " - "(str org-mode-print-catcher)))") - (if (member "code" result-params) "code" "simple") body) - body))) + (cond ((or (member "code" result-params) (member "pp" result-params)) + (format (concat "(let [org-mode-print-catcher (java.io.StringWriter.)] " + "(clojure.pprint/with-pprint-dispatch clojure.pprint/%s-dispatch " + "(clojure.pprint/pprint (do %s) org-mode-print-catcher) " + "(str org-mode-print-catcher)))") + (if (member "code" result-params) "code" "simple") body)) + ;; if (:results output), collect printed output + ((member "output" result-params) + (format "(clojure.core/with-out-str %s)" body)) + (t body)))) (defun org-babel-execute:clojure (body params) "Execute a block of Clojure code with Babel." |