all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Fix issue with ob-clojure not returning output
@ 2017-03-03  4:25 Tim Cross
  2017-03-05 17:14 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Cross @ 2017-03-03  4:25 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 672 bytes --]

The attached patch is a simple fix for the problem with ob-clojure using an
incorrect cider-current-session call instead of cider-current-ns. For
background on the issue see
https://emacs.stackexchange.com/questions/30857/clojure-code-evaluation-in-org-mode-produces-no-output/31169#31169


Not 100% convinced that the optional namespace argument should even be
included - it really doesn't seem to do anything. However, leaving it in
seemed like the minimal change needed.  Have tested it and at least I now
get data back from evaluation of clojure code blocks where previously, you
only got the message "block processed with no output".

-- 
regards,

Tim

--
Tim Cross

[-- Attachment #1.2: Type: text/html, Size: 1033 bytes --]

[-- Attachment #2: ob-clojure.patch --]
[-- Type: text/x-patch, Size: 1335 bytes --]

---
 lisp/ob-clojure.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index d407105..e542a29 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -44,6 +44,7 @@
 
 (declare-function cider-current-connection "ext:cider-client" (&optional type))
 (declare-function cider-current-session "ext:cider-client" ())
+(declare-function cider-current-ns "ext:cider-client" ())
 (declare-function nrepl--merge "ext:nrepl-client" (dict1 dict2))
 (declare-function nrepl-dict-get "ext:nrepl-client" (dict key))
 (declare-function nrepl-dict-put "ext:nrepl-client" (dict key value))
@@ -118,7 +119,7 @@ using the :show-process parameter."
 			    org-babel-clojure-sync-nrepl-timeout))
 		       (nrepl-sync-request:eval expanded
 						(cider-current-connection)
-						(cider-current-session))))
+						(cider-current-ns))))
 	       (setq result
 		     (concat
 		      (nrepl-dict-get response
@@ -153,7 +154,7 @@ using the :show-process parameter."
 		;; Update the status of the nREPL output session.
 		(setq status (nrepl-dict-get response "status")))
 	      (cider-current-connection)
-	      (cider-current-session))
+	      (cider-current-ns))
 
 	     ;; Wait until the nREPL code finished to be processed.
 	     (while (not (member "done" status))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix issue with ob-clojure not returning output
  2017-03-03  4:25 [PATCH] Fix issue with ob-clojure not returning output Tim Cross
@ 2017-03-05 17:14 ` Nicolas Goaziou
  2017-03-05 21:27   ` Tim Cross
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2017-03-05 17:14 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

Hello,

Tim Cross <theophilusx@gmail.com> writes:

> The attached patch is a simple fix for the problem with ob-clojure using an
> incorrect cider-current-session call instead of cider-current-ns. For
> background on the issue see
> https://emacs.stackexchange.com/questions/30857/clojure-code-evaluation-in-org-mode-produces-no-output/31169#31169

Thank you.

Would you mind providing a commit message along with your patch ?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix issue with ob-clojure not returning output
  2017-03-05 17:14 ` Nicolas Goaziou
@ 2017-03-05 21:27   ` Tim Cross
  2017-03-07  8:10     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Cross @ 2017-03-05 21:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

Sure. Commit message

Fix incorrect argument call in ob-clojure.el

org-babel-execute-clojure was calling nrepl-sync-request:eval and
nrepl-request:eval with the session ID as the 3rd argument when the
functions expected a clojure namespace. Replaced (cider-current-session)
with (cider-current-ns).




On 6 March 2017 at 04:14, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,
>
> Tim Cross <theophilusx@gmail.com> writes:
>
> > The attached patch is a simple fix for the problem with ob-clojure using
> an
> > incorrect cider-current-session call instead of cider-current-ns. For
> > background on the issue see
> > https://emacs.stackexchange.com/questions/30857/clojure-
> code-evaluation-in-org-mode-produces-no-output/31169#31169
>
> Thank you.
>
> Would you mind providing a commit message along with your patch ?
>
> Regards,
>
> --
> Nicolas Goaziou
>



-- 
regards,

Tim

--
Tim Cross

[-- Attachment #2: Type: text/html, Size: 1856 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix issue with ob-clojure not returning output
  2017-03-05 21:27   ` Tim Cross
@ 2017-03-07  8:10     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2017-03-07  8:10 UTC (permalink / raw)
  To: Tim Cross; +Cc: Org-mode

Hello,

Tim Cross <theophilusx@gmail.com> writes:

> Sure. Commit message
>
> Fix incorrect argument call in ob-clojure.el
>
> org-babel-execute-clojure was calling nrepl-sync-request:eval and
> nrepl-request:eval with the session ID as the 3rd argument when the
> functions expected a clojure namespace. Replaced (cider-current-session)
> with (cider-current-ns).

Applied to master, since it doesn't apply correctly on maint.

I added TINYCHANGE at the end of the commit message since I don't know
if you signed FSF papers already.

Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-07  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03  4:25 [PATCH] Fix issue with ob-clojure not returning output Tim Cross
2017-03-05 17:14 ` Nicolas Goaziou
2017-03-05 21:27   ` Tim Cross
2017-03-07  8:10     ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.