$ cd ~/bin
$ wget https://github.com/technomancy/leiningen/raw/1.6.1/bin/lein
$ aptitude -Ry install emacs23-nox openjdk-6-jdk
$ lein new myproject
$ cd myproject
$ emacs project.clj
Add “swank-clojure” and “clojure-contrib” lines to it
File should look like this
(defproject myproject "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]]
:dev-dependencies [[swank-clojure "1.2.1"]])
Save file and exit out of emacs
$ lein deps
Open following link in browser
http://tromey.com/elpa/install.html
Open “emacs” and Switch to *scratch* buffer
$ emacs -nw and then C-x C-b *scratch*
Follow instructions given on “install.html” link, alternatively copy following
code to *scratch* buffer
(let ((buffer (url-retrieve-synchronously
"http://tromey.com/elpa/package-install.el")))
(save-excursion
(set-buffer buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(eval-region (point) (point-max))
(kill-buffer (current-buffer))))
Evaluate above code using “M-x eval-buffer” command
Run “M-x package-list-packages”
Install “swank-clojure” package
Use “C-s” to Search package name
Use “i” to select package and then press “x” to install.
This should also install “clojure-mode” “slime” “slime-repl” packages.
Switch to another terminal
$ cd ~/myproject
$ lein swank
This will start “swank” server on 127.0.0.1:4005 by default
Go back to running emacs instance and type
“M-x slime-connect”
It will prompt for “host” and “port”, press to accept default values
Your Hacking Starts Now!!!
You may get a version mismatch warning after running “slime-connect”. To remove
this warning
$ cd ~/.emacs.d/elpa/slime-20100404/
and remove .elc file
$ rm slime.elc
Distro : Ubuntu 11.04
Package Versions : Emacs – 23.2, Lein – 1.6.1, Clojure – 1.2.1, Clojure-Contrib – 1.2.0, Swank-Clojure – 1.2.1, OpenJDK-6-JDK – 6b22-1