|
@@ -84,16 +84,10 @@
|
|
vars "\n ")
|
|
vars "\n ")
|
|
"]\n" body ")")
|
|
"]\n" body ")")
|
|
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))))
|
|
|
|
|
|
+ (if (or (member "code" result-params)
|
|
|
|
+ (member "pp" result-params))
|
|
|
|
+ (format "(clojure.pprint/pprint (do %s))" body)
|
|
|
|
+ body)))
|
|
|
|
|
|
(defun org-babel-execute:clojure (body params)
|
|
(defun org-babel-execute:clojure (body params)
|
|
"Execute a block of Clojure code with Babel."
|
|
"Execute a block of Clojure code with Babel."
|
|
@@ -106,7 +100,8 @@
|
|
(setq result
|
|
(setq result
|
|
(plist-get
|
|
(plist-get
|
|
(nrepl-send-string-sync expanded)
|
|
(nrepl-send-string-sync expanded)
|
|
- (if (member "output" result-params)
|
|
|
|
|
|
+ (if (or (member "output" result-params)
|
|
|
|
+ (member "pp" result-params))
|
|
:stdout
|
|
:stdout
|
|
:value)))))
|
|
:value)))))
|
|
(nrepl
|
|
(nrepl
|