From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: ob-clojure broken Date: Sat, 4 Mar 2017 23:37:27 +1100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11375426d74ccd0549e6eca9 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ck8wG-0007M2-NY for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 07:37:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ck8wF-0004Dw-6B for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 07:37:32 -0500 Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:34954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ck8wE-0004D0-VY for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 07:37:31 -0500 Received: by mail-qk0-x234.google.com with SMTP id v125so35098179qkh.2 for ; Sat, 04 Mar 2017 04:37:29 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "numbchild@gmail.com" Cc: Org-mode --001a11375426d74ccd0549e6eca9 Content-Type: text/plain; charset=UTF-8 thanks. There is a later message to the list where I attached the patch. tim On 4 March 2017 at 23:04, numbchild@gmail.com wrote: > I already applied the patch at here: https://emacs. > stackexchange.com/questions/30857/clojure-code-evaluation- > in-org-mode-produces-no-output > > > [stardiviner] GPG key ID: 47C32433 > IRC(freeenode): stardiviner Twitter: @numbchild > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > Blog: http://stardiviner.github.io/ > > On Thu, Mar 2, 2017 at 7:01 AM, Tim Cross wrote: > >> With current 9.0.5 org-plus-contrib package, ob-clojure is broken and >> trying to evaluate clojure source blocks just gives a code block produces >> no output message. >> >> The problem is in the org-babel-execute:clojure function. This function >> has the following bit of code >> >> (setq result >> (nrepl-dict-get >> (nrepl-sync-request:eval >> expanded (cider-current-connection) (cider-current-session)) >> (if (or (member "output" result-params) >> (member "pp" result-params)) >> "out" >> "value"))) >> >> The problem is in the call to nrepl-sync-request:eval. The documentation >> states for this function >> >> (nrepl-sync-request:eval INPUT CONNECTION &optional NS) >> >> Send the INPUT to the nREPL server synchronously. The request is >> dispatched via CONNECTION. If NS is non-nil, include it in the request. >> Note the last optional argument NS. This is supposed to be a clojure >> namespace. However, the org-babel-execute:clojure function is calling this >> function with the output from cider-current-session, which returns a unique >> ID representing the current session. As a result, the call is returning a >> data structure with an error and no output (perhaps some error handling is >> required). The returned result is >> >> (dict status (namespace-not-found done error done state state) id 17 >> session 43e9fd6c-82ed-49fe-9624-0cfc6f56f8b1 changed-namespaces (dict) >> repl-type cljclj) >> >> Note the namespace-not-found >> >> Either the argument should be a call to (cider-current-ns) or perhaps it >> should just be left out as I don't see how you can pass the namespace as >> part of the block evaluation. >> >> >> -- >> regards, >> >> Tim >> >> -- >> Tim Cross >> >> > -- regards, Tim -- Tim Cross --001a11375426d74ccd0549e6eca9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thanks. There is a later message to the list where I attac= hed the patch.

tim


On 4 March 2017 at 23:04, <= a href=3D"mailto:numbchild@gmail.com">numbchild@gmail.com <numbchild= @gmail.com> wrote:

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C3= 2433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36= =C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
=

On Thu, Mar 2, 2017 at 7:01 AM, Tim Cross <theophilusx@gmail.com> wrote:
With current 9.0.5 org-plus-contrib package, ob-clo= jure is broken and trying to evaluate clojure source blocks just gives a co= de block produces no output message.

The problem is= in the org-babel-execute:clojure function. This function has the following= bit of code

(setq result
=C2=A0 =C2=A0 = =C2=A0 =C2=A0(nrepl-dict-get
=C2=A0 =C2=A0 (nrepl-sync-request:ev= al
=C2=A0 =C2=A0 =C2=A0expanded (cider-current-connection) (cider= -current-session))
=C2=A0 =C2=A0 (if (or (member "output&quo= t; result-params)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (member "pp&qu= ot; result-params))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "out"
=C2=A0 =C2=A0 =C2=A0 "value")))

The problem is in the call to nrepl-sync-request:eval. The documentation s= tates for this function

(nrepl-sync-request:eval I= NPUT CONNECTION &optional NS)

Send the INPUT t= o the nREPL server synchronously. The request is dispatched via CONNECTION.= If NS is non-nil, include it in the request.
Note the last optio= nal argument NS. This is supposed to be a clojure namespace. However, the o= rg-babel-execute:clojure function is calling this function with the output = from cider-current-session, which returns a unique ID representing the curr= ent session. As a result, the call is returning a data structure with an er= ror and no output (perhaps some error handling is required). The returned r= esult is

(dict status (namespace-not-found done er= ror done state state) id 17 session 43e9fd6c-82ed-49fe-9624-0cfc6f56f8= b1 changed-namespaces (dict) repl-type cljclj)

Not= e the namespace-not-found

Either the argument shou= ld be a call to (cider-current-ns) or perhaps it should just be left out as= I don't see how you can pass the namespace as part of the block evalua= tion.


--
regards,

Tim

--
Tim Cross





--
regards,

Tim

--
T= im Cross

--001a11375426d74ccd0549e6eca9--