1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

* lisp/ob-clojure.el: Support for clojurescript src block execution.

* lisp/ob-clojure.el (org-babel-execute:clojurescript): New function to
Execute ClojureScript src block.

TINYCHANGE
This commit is contained in:
Robert Hambrock 2020-02-13 23:18:32 +08:00 committed by Bastien
parent 937ac9b777
commit d37fc58150

View File

@ -135,7 +135,8 @@ using the :show-process parameter."
(cider
(require 'cider)
(let ((result-params (cdr (assq :result-params params)))
(show (cdr (assq :show-process params))))
(show (cdr (assq :show-process params)))
(connection (cider-current-connection (cdr (assq :target params)))))
(if (member show '(nil "no"))
;; Run code without showing the process.
(progn
@ -143,7 +144,7 @@ using the :show-process parameter."
(let ((nrepl-sync-request-timeout
org-babel-clojure-sync-nrepl-timeout))
(nrepl-sync-request:eval expanded
(cider-current-connection))))
connection)))
(setq result
(concat
(nrepl-dict-get response
@ -177,7 +178,7 @@ using the :show-process parameter."
(nrepl--merge response resp)
;; Update the status of the nREPL output session.
(setq status (nrepl-dict-get response "status")))
(cider-current-connection))
connection)
;; Wait until the nREPL code finished to be processed.
(while (not (member "done" status))
@ -217,6 +218,12 @@ using the :show-process parameter."
(condition-case nil (org-babel-script-escape result)
(error result)))))
(defun org-babel-execute:clojurescript (body params)
"Execute a block of ClojureScript code with Babel.
The underlying process performed by the code block can be output
using the :show-process parameter."
(org-babel-execute:clojure body (cons '(:target . "cljs") params)))
(defun org-babel-clojure-initiate-session (&optional session _params)
"Initiate a session named SESSION according to PARAMS."
(when (and session (not (string= session "none")))