[Top][All Lists]

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

[O] ob-clojure broken

From: Tim Cross
Subject: [O] ob-clojure broken
Date: Thu, 2 Mar 2017 10:01:03 +1100

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
     expanded (cider-current-connection) (cider-current-session))
    (if (or (member "output" result-params)
        (member "pp" result-params))

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.



Tim Cross

reply via email to

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