"Steven E. Harris" <s...@panix.com> writes: > Rob Wolfe <r...@smsnet.pl> writes: > >> I did it like this (I assume that clojure-mode.el has been installed): > > Thanks, Rob. I followed your instructions after not being able to get > Clojure to cooperate with my normal Swank/SLIME installation, and it > works, but only to a point: The SLIME REPL buffer (invoked via the > function `slime-repl') falls out of step with the *inferior-lisp* > buffer.
So how do you exactly start SLIME for Clojure? These settings: (require 'slime) (slime-setup '(slime-repl)) (defun run-clojure () "Starts clojure in Slime" (interactive) (slime 'clojure)) should cause automatic start of *inferior-lisp* and *slime-repl clojure* after typing "M-x run-clojure" > > This never happens to me when using SLIME with a Common Lisp, such as > CLISP. Here, Clojure starts up just fine in the *inferior-lisp* buffer, > but the SLIME REPL doesn't seem to connect properly. Maybe it connects > at the network level, but each form entered in the SLIME REPL yields > messages like this in the minibuffer: > > ,---- > | ; pipelined request... (swank:listener-eval " > `---- What do you see in *messages* buffer? Maybe there are some helpful messages. I can see this: """ Polling "/tmp/slime.6251".. (Abort with `M-x slime-abort-connection'.) [31 times] Connecting to Swank on port 40585.. [2 times] Connected. Hacks and glory await! """ What version of Clojure do you use? I use clojure.jar built from sources taken from GIT repository (I tried Clojure 1.0 and it worked too). I agree with Stefan Kamphausen that "connection-serve" in swank.clj should not fail silently. Now we don't know what is the problem. If I were you I would change this function as Stefan suggested and see what is going on: <code> (defn- connection-serve [conn] (let [control (dothread-swank (thread-set-name "Swank Control Thread") (try (control-loop conn) (catch Exception e ;; fail silently (.printStackTrace e) (.printStackTrace (.getCause e)) nil))) read (dothread-swank (thread-set-name "Read Loop Thread") (try (read-loop conn control) (catch Exception e ;; This could be put somewhere better (.interrupt control) (dosync (alter *connections* (partial remove #{conn}))))))] (dosync (ref-set (conn :control-thread) control) (ref-set (conn :read-thread) read)))) </code> > > That's a sign that the REPL is sending commands to the SWANK back-end, > but it's not receiving a timely response. Meanwhile, the Clojure REPL in > the *inferior-lisp* buffer remains responsive. > > Trying to evaluate Clojure forms from a buffer other than the REPL (via, > say, `C-x e', usually doesn't work. There's no error reported, but none > of the resulting values display in the minibuffer, and any definitions > evaluated there have no apparent side effect on the Clojure REPL > available in the *inferior-lisp* buffer. > > I've also noticed that the SLIME "presentations" feature doesn't work > with Clojure. That may be a symptom of the SLIME REPL not meeting up > properly with the Clojure REPL. Yes, apparently connection with *slime-repl clojure* failed and it does not work properly now. HTH, Rob -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en