Вопрос

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:

  • GNU Emacs 23.2.1 on debian squeeze (stable) amd64
  • slime installed through the debian repositories
  • sun-java6-jre
  • leiningen 1.6.2
  • swank-clojure 1.3.3
  • clojure 1.3.0

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.

Другие советы

I uninstalled the debian version of slime and installed slime-repl through ELPA. Everything works now although the installation seemed to fail with a compilation error: lime-repl.el:122:39:Error: No setf-method known for slime-connection-output-buffer

Another question though: what is a "polite" way to exit slime? If I use M-x slime-disconnect, it causes an exception in the remote swank-server instance:

java.lang.Exception: Error reading swank message
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top