Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to evaluate form in nrepl + emacs

Tags:

emacs

clojure

I have installed the nrepl, clojure-mode and starter-kit-lisp packages. I am able to start the nrepl by opening my .clj file and then M-x nrepl-jack-in.

However when I evaluate any form in my .clj file by C-x C-e, I get the following message:

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

How do I get it right?

like image 220
murtaza52 Avatar asked Jan 04 '13 15:01

murtaza52


2 Answers

I have had this problem a number of times. In all cases, it has been because while nrepl has started, the nrepl minor mode has not been enabled in the clj buffer. As a result, any evaluation attempts fail with this error.

There should be a "nrepl" menu item. If there isn't, this may be your problem. M-x nrepl-enable-on-existing-buffers should fix it.

I had this problem for a while, and now it appears to have gone away; you might want to try installing clojure-mode and nrepl afresh.

like image 67
Phil Lord Avatar answered Nov 01 '22 07:11

Phil Lord


Are you sure M-x nrepl-jack-in worked? If it did, you should be prompted with a repl in emacs, like so:

nrepl jack-in

nrepl requires leiningen 2, so make sure that you use the right version in your project and that the nrepl plugin is properly installed.

Also make sure that the major mode when editing your .clj file is clojure-mode.

You might want to post a screenshot to make it easier to spot the problem.

like image 24
Jean-Louis Giordano Avatar answered Nov 01 '22 09:11

Jean-Louis Giordano