How to: Latest Clojure in Windows Vista (and others) with EmacsW32
- Download EmacsW32 and install it from: http://ourcomments.org/cgi-bin/emacsw32-dl-latest.pl. You need to set HOME environment variable to point to your home directory. Note: the path is case sensitive! Otherwise Emacs will write all its stuff into users AppData directory.
- Install ELPA, copy the following to *scratch* buffer in Emacs:
(let ((buffer (url-retrieve-synchronouslyPlace cursor right at the end of the last parentheses and press CTRL-j, which will run the code.
(re-search-forward "^$" nil 'move)
(eval-region (point) (point-max))
- M-x means press ALT-x in Emacs, write the text after it, and press enter. Tab completion works. Try package- to find out different commands.
clojure-mode (press enter)
- At this point you need to install Git. Best way to do this in Windows Vista seems to be msysgit at this point. One could also install Git through Cygwin, but installing Cygwin just for Git seems a bit too much work.
msysgit is found here: http://code.google.com/p/msysgit/downloads/list. Use the full installer.
Personally I don't click Windows integration on, because it throws crap into my context menu, which is supremely annoying.
- Download and install Apache Ant. Set it into your path. This includes downloading and extracting the archive, setting ANT_HOME to Ant root, Ant bin directory into PATH, and JAVA_HOME pointing to JDK root (if you haven't already).
- M-x clojure-install. This will take a while as it downloads everything required from Git repositories and compiles them. I used c:/code/clj as my Clojure installation root.
- Add (clojure-slime-config "PATH") to your .emacs config file, where PATH is the path to your Clojure installation, which you specified during M-x clojure-install.
- Optionally you can M-x package-install paredit for some additional lispy goodness.
- Read up some documentation on Emacs, SLIME and Clojure. Happy hacking!
(add-hook 'slime-connected-hook (lambda () (require 'clojure-mode)))
I don't like the toolbar so (tool-bar-mode -1) removes that.
Additionally, you might want to include additional libraries into Java classpath, which can be done by writing the following into .emacs configuration file, before package-initialize:
(setq swank-clojure-extra-classpaths (list "c:/code/java/libs/swt/swt.jar" "c:/more/java/libs/foo.jar"))
Plan B: Install Clojure Box, which uses Clojure 1.0.0