Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a fast way for connect clojure swank and slime for a fast repl in emacs?

I've a question:

When I use emacs with clojure and elein (leiningen extension) I write my code inside a file, then I need connect to swang, I type "elein swank" and open the conexion...2 step) I open a repl...3) I type slime-connect (and press y two times) 4) this step is really annoying: I need use my file or change the namespace...

so far so good..the problem is if inside my file there is a little mistake (maybe a parentheses) now I insult my code and I've repeat all steps...again!!

for me this is really annoying, I really like emacs, I've used this for long time and is the best editor, but comparing this to netbeans (I try this today..It's nice but its repl suck...) with netbeans I only need ONE click for do all these steps...

I can press "load file" and this load my file inside repl....seriously!! and if I press refer alias/file in NS it open the repl and change the namespace...so good

now..my question is if is possible create a command inside emacs than make everything..maybe and it would be really nice..a command than open a repl and load my file or my ns...would be great...is it possible?...has someone do it??..thanks

thanks a lot a have a good day!!

like image 525
clagccs Avatar asked Feb 23 '23 11:02

clagccs


1 Answers

elein-swank should automatically connect to the swank backend after starting it for you. There was a recently-fixed bug which prevented this for some swank-clojure versions, so you might want to update your elein.el to the latest version.

You can use elein-reswank to restart the backend and reconnect to it if necessary.

Once it's running, C-c C-k will compile and load a .clj file in the backend. C-c C-z will flip you to the REPL from any clojure source buffer.

Hopefully those tips will help to streamline your emacs/slime experience -- it's really a nice working environment, so stick with it if you can! :-)

like image 63
sanityinc Avatar answered May 16 '23 06:05

sanityinc