public
Description: A mode for emacs that handles clojure
Home | Edit | New

Getting Started

1. First, grab the latest of everything

Make sure you have a working copy of Emacs. Because the clojure project and its user contributions change so quickly don’t bother downloading any pre-compiled packages at all, especially clojure itself. Grab clones of the clojure, clojure-mode, swank-clojure projects from github. You can build clojure from the command line simply by running ant inside the clojure directory like so (assuming you have the JDK):


> cd /path/to/clojure-git-clone/
> ant

2. .emacs and an elisp directory

If you don’t have an .emacs file create one in your home directory. This is the initialization file that Emacs reads when it starts ups. Create a directory in your home folder where you will store Emacs lisp projects such as clojure-mode and swank-clojure. I call my directory “elisp” but it doesn’t matter except that it affects the pathnames you will use.

3. Get SLIME

You should grab the CVS snapshot of SLIME from here http://common-lisp.net/project/slime/. Put this in your emacs lisp directory. Add the following to your .emacs file.


(add-to-list 'load-path "/path/to/your/emacs-lisp-dir/slime/")
(require 'slime)

4. Setting up clojure-mode and swank-clojure

Edit your .emacs file as described in the README for clojure-mode.

For swank-clojure the description didn’t quite work for me so I used the following instead:


(add-to-list 'load-path "/path/to/swank-clojure/swank-clojure.el")
(setq swank-clojure-jar-path "/path/to/clojure/clojure.jar")
;;(setq swank-clojure-extra-classpaths (list "/path/to/other/jars"))
(require 'swank-clojure-autoload)

Hopefully this helps.

Last edited by swannodette, Thu Oct 23 11:59:44 -0700 2008
Home | Edit | New
Versions: