简体   繁体   中英

Org-Babel Clojure Cider NRepl broken?

I followed the instructions here and wrote the following org-mode file:

#+BEGIN_SRC emacs-lisp
  (princ (concat (format "Emacs version:\n%s\n" (emacs-version))
                 (format "\norg version: %s\n" (org-version))))
#+END_SRC

#+RESULTS:
: Emacs version:
: GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
:  of 2016-09-17
: 
: org version: 9.0.5

#+BEGIN_SRC clojure :results value
  (* 6 7)
#+END_SRC

#+RESULTS:

* COMMENT org babel settings
Local variables:
org-confirm-babel-evaluate: nil
End:

As you can see, the evaluation of the emacs-lisp block works and produces the expected output. Incidentally, it also reports the versions of things I'm using. However, the clojure source block, when evaluated, leaves

 Code block returned no value. 

I tried many different Clojure expressions in the code block, such as println s and more. Nothing shows up in the NREPL window, and the results in org mode are always the same: the message above in the minibuffer.

in the emacs minibuffer. Here are the specific steps I took:

  1. $ lein new clojure-example
  2. $ cd clojure-example
  3. $ emacs clojure.example.org
  4. keyboarded in the file above
  5. run emacs command cider-jack-in

That produces a repl window with the following version info:

 ;; Connected to nREPL server - nrepl://localhost:52695 ;; CIDER 0.15.0snapshot (package: 20170403.402), nREPL 0.2.12 ;; Clojure 1.8.0, Java 1.8.0_121 

etc.

  1. put emacs cursor inside each block and type Cc Cc , which is bound to org-babel-execute-src-block

Prior to that, I inserted the following code in my emacs initialization file:

(require 'org)
(require 'ob-clojure)
(org-babel-do-load-languages
 'org-babel-load-languages
 '( (clojure     . t)
    (emacs-lisp  . t)
    ))
(setq org-babel-clojure-backend 'cider)
(require 'cider)

According to the cited instructions.

I'd be grateful for any help.

Yes, in the current stable release (9.0.5), the org-mode clojure backend is broken and does not work. I submitted a patch which has been applied and I expect will be in the next release.

See https://emacs.stackexchange.com/questions/30857/clojure-code-evaluation-in-org-mode-produces-no-output/31169#31169

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM