technomancy / swank-clojure

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

emacs24 with current slime dies #130

Closed pnathan closed 12 years ago

pnathan commented 12 years ago

Hi, I am using emacs24 on osx 10.6 with Clojure 10.4 and a current leiningen.

Clojure/swank/slime dies about 10 seconds after I start it.

lein swank

M-x slime-connect

Then, I get a message:

Versions differ: 2012-05-12 (slime) vs. 20100404 (swank). Continue? (y or n) y ;; I bet this is the problem, but I'm not sure how to update swank - I sure don't want to downgrade slime.

Then, shortly thereafter, the included exception happens in the swank terminal and emacs's slime closes.

My slime settings are as follows:

  (require 'clojure-mode)

(eval-after-load 'slime
  '(progn
     (slime-setup '(
                    slime-asdf
                    slime-autodoc
                    slime-editing-commands
                    slime-fancy-inspector
                    slime-fontifying-fu
                    slime-fuzzy
                    slime-indentation
                    ;slime-mdot-fu
                    slime-package-fu
                    slime-references
                    slime-repl
                    slime-sbcl-exts
                    slime-scratch
                    slime-xref-browser
                    ))
     (slime-autodoc-mode)
     (setq slime-complete-symbol*-fancy t)
     (setq slime-complete-symbol-function
           'slime-fuzzy-complete-symbol)))

Note that this is tuned towards Common Lisp development. Stripping things down to just clojure and slime-repl gets things sort of working, but I keep getting these sorts of errors

"error in process filter: slime-editing-mode: Wrong number of arguments: called-interactively-p, 1 error in process filter: Wrong number of arguments: called-interactively-p, 1 "

It would be really nice not to have to rebuild my .emacs to dynamically load and unload modules to handle both Clojure and Common Lisp.

Connection opened on localhost port 4005.
^Xunreadable message: (:emacs-rex (swank:autodoc (quote ("+" "" swank::%cursor-marker%)) :print-right-margin 203) "user" :repl-thread 4)

exception in read loop
java.lang.RuntimeException: Invalid token: swank::
    at clojure.lang.Util.runtimeException(Util.java:170)
    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:1707)
    at clojure.core$read_string.invoke(core.clj:3361)
    at swank.core.protocol$read_swank_message$fn__238.invoke(protocol.clj:46)
    at swank.core.protocol$read_swank_message.invoke(protocol.clj:45)
    at swank.core.connection$read_from_connection.invoke(connection.clj:59)
    at swank.core$read_loop.invoke(core.clj:463)
    at swank.swank$connection_serve$fn__1871$fn__1872.invoke(swank.clj:33)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:601)
    at swank.swank$connection_serve$fn__1871.doInvoke(swank.clj:30)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:680)
exception in control loop
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1961)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at swank.util.concurrent.mbox$receive.invoke(mbox.clj:28)
    at swank.core$control_loop.invoke(core.clj:523)
    at swank.swank$connection_serve$fn__1832$fn__1833$fn__1834.invoke(swank.clj:23)
    at swank.swank$connection_serve$fn__1832$fn__1833.invoke(swank.clj:22)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:601)
    at swank.swank$connection_serve$fn__1832.doInvoke(swank.clj:20)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:680)
purcell commented 12 years ago

As noted in the README, you (unfortunately) can't set up a single recent version of slime and expect to use it for both Clojure and Common Lisp. However, by deferring loading of Slime until it's needed, you can set up your Emacs such that both language environments work in isolated Emacs instances. See #66 for more info.

I believe this is a limitation resulting from the refusal of upstream Slime developers to accommodate changes required to put Clojure on an equal footing with Common Lisp.

technomancy commented 12 years ago

It's also due to the fact that the Slime developers don't cut stable releases and introduce backwards-incompatible changes whenever: http://p.hagelb.org/slime-cvs-rant.txt

pnathan commented 12 years ago

This is quite unfortunate. I like to run my emacs for weeks on end, switching between multiple projects and languages.

I obviously had overlooked the CL information when I had perused the readme before. The only Slime development discussion record I found was http://lists.common-lisp.net/pipermail/slime-devel/2009-November/016913.html . That was 2.5 years ago. #66 gives a nice intro, but that was 9 months ago, and it appears that emacs must be restarted between Clojure/CL work.

It would be nice to know what (precisely) is broken... and what would need to be fixed. ie, what would the patch look like to bring swank-clojure up to interop with July 7 2012 slime. I do understand the daily cost of maintenance to ensure correctness, but I really would like to be able to not have to spawn a special "clojure emacs" process...

technomancy commented 12 years ago

I don't think anyone has done the investigation to discover exactly what the backwards-incompatible changes upstream are.

I would accept a patch to add compatibility for the current CVS version of slime provided it didn't break compatibility with the frozen version. Dropping support for the frozen version is not an option; it would provide a small benefit for a small number of users while creating a large hassle for everyone else.