0

I'm using emacs live to set up my clojure environment. 1) What command would cause nrepl to try and evaluate the entire file upon jack-in? 2) Is there some place where session state is saved?

For some unknown reason emacs is now trying to evaluate the entire clojure file when I execute M-x nrepl-jack-in. It used to not do that. I have an error in my file and, since the execution fails, I can't start nrepl with this file. This is not the first time I've run into some semantics that change. I've tried restarting emacs but that doesn't help.

Thanks

MattR
  • 55
  • 3
  • 1
    What file is being loaded? What is the specific error? For example if project.clj was malformed, that should prevent jack-in from working. Are you able to jack-in from a directory with no clojure project (this should provide a generic clojure repl with minimal deps as provided by lein repl in a projectless directory). – noisesmith Jun 02 '14 at 17:45
  • If I have any clj file previously loaded in a buffer and I try jack-in it now tries to execute the clj file. If there's an error in that file then the nrepl-server fails to start. I see the file error printed but I don't see the nrepl error. The directory emacs was started from is the home directory and it is not a project directory. If there is no clj file in a buffer then jack-in works fine. It used to not do this so I don't know what changed. – MattR Jun 03 '14 at 14:40
  • The directory you jack-in from is not the directory emacs was started from. The default directory for any emacs buffer is the directory of that buffer's file (if any). You need to be visiting a file in your home directory (or dired of the directory yourself) to be sure you are jacking in from the home directory. – noisesmith Jun 03 '14 at 15:35
  • It sounds like you're right. I fixed the errors and jack-in doesn't cause any errors. If I call jack-in while the cursor is in the clj file it executes the file. If I call it from *scratch* it doesn't. If I put an error back in and call from that pane it finds the error. Thank you. Write up the obvious result and I'll give you the star. – MattR Jun 03 '14 at 21:37

1 Answers1

1

nrepl's jack-in behavior is dependent on the location of the file backing the buffer you are visiting when you invoke the jack-in command.

To get a vanilla no-project repl, be sure to run nrepl-jack-in from a buffer where there is no Clojure project. To run a repl in a specific project via jack-in, run it while visiting a file in the top level of that project (project.clj is a prime cantidate).

noisesmith
  • 20,076
  • 2
  • 41
  • 49