Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Regarding Clojure on Emacs, just use the up-to-date stuff by technomancy. The following is based on my notes from a recent talk by Phil Hagelberg at a Boston Clojure Meetup.

1. Download lein from https://github.com/technomancy/leiningen/raw/stable/bin/lein

2. Launch lein (self-install) from the command line.

3. Run lein plugin install swank-clojure 1.3.0 on the command line.

4. When you first run swank, it may complain you do not have project.clj or something like that, because it expects to be launched form inside a project directory. You may create a dummy project directory (cd; lein new dummy; cd dummy).

You need to run the above steps once, to install. Run the following at the beginning of a clojure session:

5. Run lein swank on the command line.

6. In emacs, run slime-connect (with the default parameters, most likely).

In case I have garbled the above, I am sure someone will correct me. Although I did it both on Windows and MacOs and it worked. (On Windows, I use bash shell form the MinGW project, but I see no reason for the standard Windows shell not to work.)

Separately, you may want to install clojure-mode from the same repository.

Happy hacking!



Actually the week after that meetup I realized the process could be simplified dramatically: http://technomancy.us/149 Now once you have Leiningen and clojure-mode installed it's a single M-x clojure-jack-in to get started.

Wish I had thought of that a week earlier! Could have saved us a lot of time at the meetup.

(The way you posted still works fine, so if you've already got it set up there's no need to switch.)


I set it up twice (once at the meetup), and it was not a big deal, but only because I had had prior experience in setting up clojure environments.

A single emacs function to update/start clojure seems a good way to go, however I had it in the past and as soon as the dependencies broke I had to go in and figure out what was going on under the hood and how to fix it. Which is educational but distracting. Will your setup still work in 12 months?

Thanks for all the effort in bringing Clojure to the masses! :-)

P.S. Got an error -- will submit a bug report. EDIT: wrote a blog comment instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: