Emacs, Clojure, lein and nrepl: * nrepl * buffer is empty

I created a new project with lein . I open core.clj in emacs. I definitely launched Mx clojure-mode and Mx nrepl-enable-on-existing-clojure-buffers .

Then I run Mx nrepl-jack-in , and in the minibuffer I get

Starting the nREPL server ...

followed by a message, for example:

Connected You must be unhappy if you optimize everything. -Donald Knut

I see that the buffer name is *nrepl* , but the buffer does not contain Clojure Repl and instead is completely empty.

If I type anything (means anything at all), I get:

Invalid type argument: integer-or-marker-p, nil

If I go back to the core.clj buffer and press Cc Cl , I get the name of the last function in my buffer in the minibuffer as a result. And if I put my cursor at the end of the function definition and hit Cx Ce , I get:

CompilerException java.lang.RuntimeException: cannot resolve character: x in this context, compilation: (NO_SOURCE_PATH: 1: 1)

I tried to create a new lein directory with no dependencies using lein new project-name , and tried the same steps as above and got the same results.

What else can I check and / or what am I doing wrong?

EDIT: Additional Information

When I enter something into the empty *nrepl* buffer and try to press Cx Ce on what I typed, in the mini-buffer I get the message:

No Lisp subprocess; see the variable `inferior-lisp-buffer '

In addition, I run:

GNU Emacs 24.3.1

Leiningen 2.1.2 in Java 1.6.0_27 64-bit server version of OpenJDK

+6
source share
1 answer

I just fixed this exact problem in my own setup. Move your .emacs.d to a backup location and back up your .emac. Create a new .emacs with only the following lines:

 (require 'package) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) (package-initialize) (require 'clojure-mode) (require 'nrepl) 

After installing nrepl and clojure -mode by running Mx package-list-packages and setting their corresponding entries, you can use nrepl.

Add your own .emacs back to one logical unit at a time, and you have to figure out where the conflict is and resolve it. Be suspicious of anything related to mucus / swank.

+3
source

Source: https://habr.com/ru/post/951632/


All Articles