From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: ob-clojure broken Date: Thu, 2 Mar 2017 10:01:03 +1100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113754267c22110549b34917 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjDF6-0004lC-5G for emacs-orgmode@gnu.org; Wed, 01 Mar 2017 18:01:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjDF5-0007Gt-1A for emacs-orgmode@gnu.org; Wed, 01 Mar 2017 18:01:08 -0500 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:33054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjDF4-0007Gg-TT for emacs-orgmode@gnu.org; Wed, 01 Mar 2017 18:01:06 -0500 Received: by mail-qk0-x22e.google.com with SMTP id n127so96589753qkf.0 for ; Wed, 01 Mar 2017 15:01:05 -0800 (PST) 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: emacs-orgmode@gnu.org --001a113754267c22110549b34917 Content-Type: text/plain; charset=UTF-8 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 --001a113754267c22110549b34917 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
With current 9.0.5 org-plus-contrib package, ob-clojure is= broken and trying to evaluate clojure source blocks just gives a code bloc= k 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:eval
=C2=A0 =C2=A0 =C2=A0expanded (cider-current-connection) (cider-curren= t-session))
=C2=A0 =C2=A0 (if (or (member "output" resu= lt-params)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (member "pp" res= ult-params))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "out"
=C2=A0 =C2=A0 =C2=A0 "value")))

The pr= oblem is in the call to nrepl-sync-request:eval. The documentation states f= or this function

(nrepl-sync-request:eval INPUT CO= NNECTION &optional NS)

Send the INPUT to the n= REPL server synchronously. The request is dispatched via CONNECTION. If NS = is non-nil, include it in the request.
Note the last optional arg= ument NS. This is supposed to be a clojure namespace. However, the org-babe= l-execute:clojure function is calling this function with the output from ci= der-current-session, which returns a unique ID representing the current ses= sion. 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 i= s

(dict status (namespace-not-found done error don= e state state) id 17 session 43e9fd6c-82ed-49fe-9624-0cfc6f56f8b1 changed-n= amespaces (dict) repl-type cljclj)

Note the namesp= ace-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.
<= div>

--
regards,

Tim

--
Tim Cross

--001a113754267c22110549b34917--