technomancy / swank-clojure

Swank/slime support for clojure
Eclipse Public License 1.0
412 stars 83 forks source link

Totally broken. #73

Closed zilti closed 12 years ago

zilti commented 12 years ago

Totally broken here - Emacs 23.3, Clojure 1.3, swank-clojure 1.3.3, slime 20100404. "error in process filter: Wrong type argument: characterp, nil" and then "error in process filter: Variable binding depth exceeds max-specpdl-size". Breaks Emacs completely. swank-clojure seems to try to rebind keys which seems to fail too.

technomancy commented 12 years ago

max-specpdl-size means there's a stack overflow somewhere. Can you turn on M-x toggle-debug-on-error so we can see what's actually happening?

zilti commented 12 years ago

I did this, but didn't get an error message from it. It just continued to print the first error (wrong type arg) indefinitely. I killed emacs after more than 2000 times (it shows that in the modeline of the clojure buffer). Hmm strange. Anyway it seems like I'm not the only one who has problems with a manually set up clojure mode - quite a few are telling that it only worked with the starter kit or the clojure box. Btw I'm sorry for the a bit aggressive title of this issue - but I spent a whole afternoon trying and trying and it just didn't work. I'm now using a compiled-from-trunk emacs with the starter kit. I'm not that much of an emacs pro yet anyway and the stuff in there, especially the open-file completion, is very nice.

fawxtin commented 12 years ago

I got a similar error. I have emacs 23, and using Slime on its newest version (I tried with old ones, and the error persists). Just had done these steps:

$ lein plugin install lein-noir 1.2.0 $ lein noir new my-website $ cd my-website $ lein plugin install swank-clojure 1.3.3 $ lein swank

And then, under emacs after an slime-connect on port 4005

It gives me the error above, but the connection still open, and after I type a list like "(* 8 8)" it kills the connection!

;;; logs

My .emacs (slime part) configuration:

http://paste.lisp.org/display/125497

The Backtrace error:

http://paste.lisp.org/display/125495

The slime-events events:

http://paste.lisp.org/display/125496

The lein swank JVM error from command line:

unreadable message: (:emacs-rex (swank:autodoc (quote ("*" swank::%cursor-marker%)) :print-right-margin 166) "user" :repl-thread 4) exception in read loop java.lang.RuntimeException: Invalid token: swank:: at clojure.lang.Util.runtimeException(Util.java:156) at clojure.lang.LispReader.interpretToken(LispReader.java:321) at clojure.lang.LispReader.read(LispReader.java:206) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1135) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.read(LispReader.java:180) at clojure.lang.RT.readString(RT.java:1681) at clojure.core$read_string.invoke(core.clj:3359) at swank.core.protocol$read_swank_message$fn275.invoke(protocol.clj:44) at swank.core.protocol$read_swank_message.invoke(protocol.clj:43) at swank.core.connection$read_from_connection.invoke(connection.clj:59) at swank.core$read_loop.invoke(core.clj:337) at swank.swank$connection_serve$fn1619$fn__1620.invoke(swank.clj:32) at clojure.lang.AFn.applyToHelper(AFn.java:159) at clojure.lang.AFn.applyTo(AFn.java:151) at clojure.core$apply.invoke(core.clj:600) at swank.swank$connection_serve$fn__1619.doInvoke(swank.clj:29) at clojure.lang.RestFn.invoke(RestFn.java:397) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:636)

technomancy commented 12 years ago

@fawxtin: the newest version of slime is known to have issues with swank-clojure. The easiest thing to do is remove all slime config on the emacs side and just use M-x clojure-jack-in so you're guaranteed to have a compatible version.

technomancy commented 12 years ago

@zilti: there's nothing in clojure-mode or swank-clojure that would affect connecting to swank based on whether you're using the starter kit or not. Usually errors like this are caused by having the wrong version of slime installed, so try removing everything clojure-related and just following the instructions in the readme.

fawxtin commented 12 years ago

@technomancy: if on my slime config, I set:

(slime-setup '(slime-repl))

instead of:

(slime-setup '(slime-fancy))

it still gives me the "(wrong-type-argument 'listp)" error, but the connection and functionality are ok.

technomancy commented 12 years ago

Strongly suspect this is caused by multiple conflicting versions of slime. If you launch a fresh Emacs instance and (featurep 'slime) evaluates to true in M-:, that means you've got an existing Slime install that's getting in the way.

teaforthecat commented 12 years ago

I am seeing the same problem. After opening emacs without the ESK, (featurep 'slime) => nil open a clojure file (clojure-jack-in) => success! then in the buffer slime-repl nil I see: ; SLIME 20100404 user> ; so looks good, but then I type "break!" to trigger an error which triggers sldb, which opens hundreds of blank buffers and after every command is the message post-command-hook (wrong-type-argument characterp nil) as mentioned above. So, one question I have is: Is the line "; SLIME 20100040" the same as you are seeing? Also, could I turn off the debugger somehow? I tried Brian's proposal with no luck. this gist is the output I'm seeing in slime events

teaforthecat commented 12 years ago

Update: After trying a few versions of slime with sbcl, I am also having blank sldb buffers, so from my perspective this error is not necessarily in swank-clojure. One difference is that I only get sldb buffers created ad inifitum with swank-clojure, with the other versions of slime I've tried I only get two blank sldb buffers.

teaforthecat commented 12 years ago

now I'm using emacs24 and starter-kit 2. sldb is working fine with clojure-jack-in. very awesome! Thanks.

galeo commented 12 years ago

It looks like sldb mode is incompatible with autopair, actually it's an emacs bug, check http://code.google.com/p/autopair/issues/detail?id=32 for detail information.