emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface


From: stardiviner
Subject: Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface
Date: Thu, 25 Oct 2018 14:11:41 +0800
User-agent: mu4e 1.1.0; emacs 26.1

address@hidden writes:

> From: Robert Hambrock <address@hidden>
>
> * 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]