Short version: errors when starting Mx slime-connect or Mx clojure-jack-in when using lein swank to start a swank server.
I am using emacs 24.0.50.1 on Ubuntu 10.10. I installed the following packages in emacs from ELPA: clojure -mode, paredit, slime, slime-repl
I installed leiningen from github and added it to the classpath, and then ran lein plugin install swank-clojure 1.3.3 . After that, I created a new directory ~ / tmp /, cd in it and ran: lein new test-project , which seemed to set everything up fine. Then I opened the file / tmp / new -project / project.clj in emacs and changed it to:
(defproject test-project "1.0.0-SNAPSHOT" :description "Test Project" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"]] :dev-dependencies [[swank-clojure "1.3.3"]])
After that, I returned to the / tmp / new -project folder and ran lein deps , then lein swank to load the dependencies and start the swank server, which gives the result:
Connection opened on local port 4005.
Emacs has a problem connecting to the swank server. I tried to open the core.clj file and run Mx slime-connect , which gives an error:
Symbol function definition is void: define-slime-contrib
Which makes me think that he either does not see that the running server is working, or there is some kind of configuration that must be made to view the server. I also tried (with the same open file and opening project.clj) Mx clojure-jack-in , which I suppose is trying to run clojure REPL in the project folder, but this gives the following:
Debugger entered--Lisp error: (error "Could not start swank server: sh: lein: not found ") signal(error ("Could not start swank server: sh: lein: not found\n")) error("Could not start swank server: %s" "sh: lein: not found\n") clojure-jack-in-sentinel(
I followed the instructions of http://matthias-schneider.org/docs/clojure-setup/ for emacs packages and installing lein, and then started following the test configuration instructions from http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html when I'm having trouble connecting Mx slime-connect to open REPL.
Update
deleted ~ / tmp / test-project, deleted emacs and / .emacs.d / elpa / packages, reinstalled emacs, reinstalled clojure -mode and paredit packages copied ~ / .lein to / bin to make sure there are no problems with the loop ( there was no certainty about the need for /.lein or / .lein / bin on the way). Ran /.lein/bin/swank-clojure and then opened emacs, opened project.clj and tried Mx slime-connect , which now asks me for the host (local by default), port (4005 by default), says the connection with swank, gives a message about swank and the slime version is different (y or n) y, then the minibuffers give an error in process filter: Lisp connection closed unexpectedly . In the terminal where I ran /.lein/bin/swank-clojure , the following java error appears:
exception in read loop java.lang.NumberFormatException: For input string: " a6" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:470) at swank.core.protocol$read_swank_message.invoke(protocol.clj:41) 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$fn__1486$fn__1487.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:540) at swank.swank$connection_serve$fn__1486.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)
Update: Solved, I had to remove emacs and remove ALL /.emacs.d/, not just the packages in / elpa /. After reinstallation, I received only the clojure-mode package, not slime or slime-repl. Now you can connect to the Mx clojure-jack-in and I'm ready to do some work!