When trying to M-x slime-connect to a swank server running in a clojure app I get a user> prompt but as soon as I start typing the connection breaks as the app throws:
exception in read loop
java.lang.RuntimeException: Invalid token: swank::
further down the stack I see:
unreadable message: (:emacs-rex (swank:autodoc (quote ("ns" "" swank::%cursor-marker%)) :print-right-margin 80) "user" :repl-thread 4)
When I start slime I get:
Versions differ: 2010-07-21 (slime) vs. 20100404 (swank). Continue? (y or n)
But this mismatch should be OK.
I have swank-clojure 1.3.3 in my project's dependencies and I have installed the leiningen plugin as well. I start swank-server with (swank.swank/start-server :host "localhost" :port 4005)
from inside the app.
My environment:
I should also mention that M-x clojure-jack-in works fine but I need to be able to connect remotely.
Could the version mismatch be the culprit? Anyone using a similar working setup?
You should upgrade to swank-clojure 1.4.0 and use the version of slime that is bundled with it. There's a 'clojure-jack-in' command in clojure-mode that will handle the loading of slime when you 'jack-in' from a clojure project to swank. All the errors you're seeing will be gone. slime-disconnect[-all] is the correct way to exit.