Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, any update on this patch? I still have this feature reminder in my GTD. Really hope ob-clojure.el can support ClojureScript too. If possible, hope this can integrate with current CIDER new session manager "sesman". roberthambr...@gmail.com writes: > From: Robert Hambrock > > * lisp/ob-clojure.el (org-babel-execute:clojure): Implemented :target, > which allows selection of connection. > * lisp/ob-clojure.el (org-babel-execute:clojurescript): New > ClojureScript interface that uses :target flag to specify `cljs` > evaluation target. > --- > lisp/ob-clojure.el | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el > index 93674b552..7f7c24ff1 100644 > --- a/lisp/ob-clojure.el > +++ b/lisp/ob-clojure.el > @@ -129,7 +129,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 > @@ -137,7 +138,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 > @@ -171,7 +172,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)) > @@ -211,6 +212,9 @@ using the :show-process parameter." >(condition-case nil (org-babel-script-escape result) > (error result) > > +(defun org-babel-execute:clojurescript (body params) > + (org-babel-execute:clojure body (cons '(:target . "cljs") params))) > + > (provide 'ob-clojure) > > ;;; ob-clojure.el ends here - -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -BEGIN PGP SIGNATURE- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5D+p8UHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsNcZwf8DtemZgXwNYF7SidMtURACKAEZkkN wxRWB6MyZ5O4AbnOxTIwYrp+GiGMshrA24NIsWvb9IPQUK4yquzukxzH+Z1/fpK/ iQpbplhFjIS2Pvzh1o+Fe1nH9jYjJx7gg6JlUAuXiJF0qHntw/XHbPRjOcF7u450 jkN/iyh7UbQd1Ds/Yy/rISi846c4Ezx6eKGH6X5btWvFjF4dop/GxA7WWl73HMyk 769pLiMRZAhy0dIKj1daQ769P0V5dS5XpZvwXy8AxJP/0sjO38x6DLpANRI92C4A gUpI5q3lGBc4frxHDpudBkIuOhX1e42n+AUGCTXB7b7Ktl7RXiTCwwP/ng== =KcNL -END PGP SIGNATURE-
Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
roberthambr...@gmail.com writes: > From: Robert Hambrock > > * lisp/ob-clojure.el (org-babel-execute:clojure): Implemented :target, > which allows selection of connection. > * lisp/ob-clojure.el (org-babel-execute:clojurescript): New > ClojureScript interface that uses :target flag to specify `cljs` > evaluation target. > --- > lisp/ob-clojure.el | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el > index 93674b552..7f7c24ff1 100644 > --- a/lisp/ob-clojure.el > +++ b/lisp/ob-clojure.el > @@ -129,7 +129,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 > @@ -137,7 +138,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 > @@ -171,7 +172,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)) > @@ -211,6 +212,9 @@ using the :show-process parameter." >(condition-case nil (org-babel-script-escape result) > (error result) > > +(defun org-babel-execute:clojurescript (body params) > + (org-babel-execute:clojure body (cons '(:target . "cljs") params))) > + > (provide 'ob-clojure) > > ;;; ob-clojure.el ends here Hi, @roberthambrock. I would like to have ob-clojure support ClojureScript too. But seems this patch is not merged yet, for a long time. Can I modify this patch and send to Org Mode? @Nicolas, can I do this? set Git commit author as "roberthambrock", and commiter as me. -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 roberthambr...@gmail.com writes: How about the progress now? - -- [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -BEGIN PGP SIGNATURE- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrl2u0ACgkQG13xyVro msMQBQgAxq0OkFQE+eXrBIZYBHAdyOha4mK/+i2RyeQX8nStsKAgvP3gCJRwkttc cCCdWH5fL0MDgWcxCMrbvZsMEXFTzKJXk+tE4BB9+PTTQ3T5zG+fMIifDOZqjo6W +OhGDFaxPiVYUFF444OVrWAVw/f6JescGDDVuveUPAiLm2A9+qkh3Nz7kROpDoGC yel9N6CuDOwZiFIDpvfsoWBAeyJNweKvhfhyHgWKiu11m6tkZ/gORdvYo+upc+YJ Oh5/OkXyKYGaX/zpIAyiA1dYthEG9pdsUPODsC3O8S6Hw+Zowseb8n7pbiXj6tOF 0VdNHgsfxEyqOL1T+DIKe+TMf38SsQ== =PkoS -END PGP SIGNATURE-
Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
Hello, roberthambr...@gmail.com writes: > * lisp/ob-clojure.el (org-babel-execute:clojure): Implemented :target, > which allows selection of connection. > * lisp/ob-clojure.el (org-babel-execute:clojurescript): New > ClojureScript interface that uses :target flag to specify `cljs` > evaluation target. Thank you. > +(defun org-babel-execute:clojurescript (body params) > + (org-babel-execute:clojure body (cons '(:target . "cljs") params))) > + Please add a docstring to the function. Regards, -- Nicolas Goaziou
Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Those patches are great. solve some of my problem. Does CIDER support ClojureScript natively so ob-clojure can integrate it? - -- [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -BEGIN PGP SIGNATURE- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrdSM0ACgkQG13xyVro msOzQQgAmJ9IJzDNNK1PirXfok2Teq4hSRZ+hNpxhH+p4+Fpd1p+MQXBAhrMsno5 2gV+wyjzshvMus2erk8O061e/ggzYt8ADuoha/NPjU/D3477CFzzuJj4FVaDiKkn 1lJCjHoR56h0xJK3PJxT72KHc1uQMMrsH3PzR2AoxfEEoSI56dlSvz3FgdXOQ8ha ODyZyHvSxFF5DzGvXUzXoVHH6SxlKzbdWKp0cAo7Ue3E9EcNYW7ASGryPW9KpyIk HOUYTurKhZIrYr7pG3zYzEWa1P1UFvoqwn1/SeR6sYKoVZo9nL81+Y2P4+h/IHqk mjlcjMoRNzIdqwNvGO5UP/cokSUJEg== =zief -END PGP SIGNATURE-
[O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
From: Robert Hambrock* lisp/ob-clojure.el (org-babel-execute:clojure): Implemented :target, which allows selection of connection. * lisp/ob-clojure.el (org-babel-execute:clojurescript): New ClojureScript interface that uses :target flag to specify `cljs` evaluation target. --- lisp/ob-clojure.el | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 93674b552..7f7c24ff1 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -129,7 +129,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 @@ -137,7 +138,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 @@ -171,7 +172,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)) @@ -211,6 +212,9 @@ using the :show-process parameter." (condition-case nil (org-babel-script-escape result) (error result) +(defun org-babel-execute:clojurescript (body params) + (org-babel-execute:clojure body (cons '(:target . "cljs") params))) + (provide 'ob-clojure) ;;; ob-clojure.el ends here -- 2.16.3