Setting up emacs with Slime on a windows machine
by Abhijeet Kashnia
For learning Lisp, initially I thought I would get by using LispWorks IDE, which is free for personal use or the other option is CormanLisp. But both aren't free software.LispWorks for professional use costs a thousand dollars a year, Corman I think is 250$. Also, note that LispWorks personal version IDE is not compatible with Slime. In any case, if you distribute any softwar built using Lispworks IDE, you need to pay them for the right to distribute your code. Not that I am in any danger of doing that (hardly write any code), but anyway, if I am trying out some new language, might as well go the full hog, and use the tools used by the vast majority of people.
Software required:
1. emacs: an editor, maybe much more than a plain editor. Comes with binary, used the one for 32 bit windows in my case.
2. Slime: extension for lisp over emacs. only needs to be copied, no installation.
3. Lisp: any implementation of Lisp. Grab any free implementation of Common Lisp. I decided to use Steel Bank Common Lisp, (which is a very weird name btw). SBCL installation will create a new environment variable called SBCL_HOME and add the same variable to the Path.
Tricky part:
After installation of emacs, C:\Documents and Settings\aman\Application Data\.emacs.d kind of folder is created. Now, ideally emacs uses a file called .emacs for configuration, and this file can run into thousands of lines for the hard core developers. This file was not present in the .emacs.d folder, but can be added manually in the Application Data folder. For setting up emacs to use our lisp implementation and the slime extension, here's the minimum content of .emacs file:
(setq inferior-lisp-program "sbcl") ; your Lisp system
(add-to-list 'load-path "I:/slime-~1/slime-~1/") ; your SLIME directory
(require 'slime)
(slime-setup)
Here load path goes till the directory that contains slime.el.
Note that the slime directory must contain windows short file name. The actual path was I:\slime-current\slime-2012-01-25, which got converted. If you don't put the path in the correct short format, emacs will complain. Lots of funny behaviour with the paths, so please watch out.
I posted this because the slime user manual was not so helpful in setting the inferior lisp program property.
I learnt the correct settings from http://lists.common-lisp.net/pipermail/slime-devel/2008-May/007331.html after wasting a lot of time.