emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix issue with ob-clojure not returning output
Date: Fri, 3 Mar 2017 15:25:17 +1100	[thread overview]
Message-ID: <CAC=50j-_+dZy_PXoXJwW+k2Lq83Br=rrB1-yWgKnc6zqBpFx=A@mail.gmail.com> (raw)


[-- 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


             reply	other threads:[~2017-03-03  4:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  4:25 Tim Cross [this message]
2017-03-05 17:14 ` [PATCH] Fix issue with ob-clojure not returning output Nicolas Goaziou
2017-03-05 21:27   ` Tim Cross
2017-03-07  8:10     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC=50j-_+dZy_PXoXJwW+k2Lq83Br=rrB1-yWgKnc6zqBpFx=A@mail.gmail.com' \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).