Hi all,

I recently started playing with leiningen, and it looks like it's
going to help remove a lot of the incidental complexity in getting
projects started with clojure!  However I had some what of a hard time
getting it going with Emacs/clojure-mode/slime...  This is likely
because clojure-mode/slime/swank evolve more quickly than I keep up,
but that in itself is a problem... especially when there's little
google-able discussion on the recomended methods online.

Anyway I finally seem to have got things worked out... so I thought
I'd document here what I tried...  Perhaps this'll be useful to
others.

My original setup was based on clojure-mode's clojure-install option
(it seems that since then this has been deprecated)...  I had
leiningen setup bootstrapped and built from the github master as
described at:

http://github.com/technomancy/leiningen

The leiningen setup & bootstrapping process for the bleeding edge
version which claims to have Emacs integration (
http://wiki.github.com/technomancy/leiningen/emacs-integration )
worked flawlessly.

In this setup, running lein swank at the terminal followed by
slime-connect would fail to work.  I assumed this was because of an
incompatibility between the swank version lein had installed, and my
old clojure-mode slime setup, so I set about reinstalling
slime/clojure-mode.

It wasn't clear what was the prefered way to install this stuff, so I
tried ELPA...  I installed ELPA by following the instructions at

http://tromey.com/elpa/install.html

The Emacs 22 instructions seemed to work ok under Emacs 23...  I then
ran package-list-packages, and selected clojure-mode,
clojure-test-mode, slime-repl, swank-clojure...  This failed as ELPA
doesn't seem smart enough to know when a dependency is already
installed...  So instead I had to delete all the packages and install
just swank-clojure (which appeared to install most of the others).

After restarting Emacs however I couldn't get clojure-mode, swank or
slime to load...  I'm not sure why...  I gave up on this approach and
tried to follow the installation instructions for installing
swank-clojure from source here:

http://github.com/technomancy/swank-clojure

This approach seemed to work, putting me firmly on the bleeding edge
of technomancy's leiningen, swank-clojure, clojure-mode and slime...
It turns out though, that to do this you also need ELPA installed...
But running M-x package-install-from-buffer works.

I'm not sure why this setup worked but the ELPA installation method didn't.

Anyway, the new swank-clojure-project function seems to work with
leiningen (picking up all dependencies from under /lib)...  Also
running

$ lein swank

and issuing a slime-connect seems to work, though this hangs the
terminal but accessing it via slime-connect is ok...  Would doing
something like this in lein swank, so as not to hang the tty be
better?

(do
  (ignore-protocol-version "2009-10-16")
  (spit (java.io.File. "port.txt") "")
  (start-server "port.txt" :port 4005 :dont-close true))

Anyway, things seem to be working... and I'm now pretty happy, but I
have some questions...

1) What is the recommended install method for this stuff?

2) Is my current setup reasonably future proof with regards to
emacs/slime and swank?  Or would I better getting the ELPA version
working?  Phil, do you keep all your master branches in sync?  i.e.
are will your github master branches allways 'work' with each other?
Would it make sense to use git submodules to version all these things
at a cross-project level?


Anyway, thanks again for all this...  Things are definitely getting
easier, regarding project setup etc!

R.

-- 
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

Reply via email to