Function: ob-clojure-eval-with-cider
ob-clojure-eval-with-cider is a byte-compiled function defined in
ob-clojure.el.gz.
Signature
(ob-clojure-eval-with-cider EXPANDED PARAMS &optional CLJS-P)
Documentation
Evaluate EXPANDED code block using cider.
When CLJS-P is non-nil, use a cljs connection instead of clj. The PARAMS from Babel are not used in this function.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ob-clojure.el.gz
(defun ob-clojure-eval-with-cider (expanded _params &optional cljs-p)
"Evaluate EXPANDED code block using cider.
When CLJS-P is non-nil, use a cljs connection instead of clj.
The PARAMS from Babel are not used in this function."
(org-require-package 'cider "Cider")
(let ((connection (cider-current-connection (if cljs-p "cljs" "clj"))))
(unless connection (sesman-start-session 'CIDER))
(if (not connection)
;; Display in the result instead of using `user-error'
"Please reevaluate when nREPL is connected"
(let ((response (nrepl-sync-request:eval expanded connection)))
(or (nrepl-dict-get response "root-ex")
(nrepl-dict-get response "ex")
(nrepl-dict-get response "out"))))))