Friday, November 17, 2006

Slimy emacs

Slimy emacs
This blog entry is being typed in emacs21. I finally decided to clear the hurdle and start learning myself emacs and try to wrestle through Paul Graham's "On lisp". Starting out with emacs has been fun, I've been working through the included tutorial, and the shortcut system already feels powerfull. Writing / programming without having to move my hand from keyboard to mouse is a really enticing prospect to me, and I'm intent on getting through the 36% of TUTORIAL remaining. This also seems like a really good time to finally trade in my azerty keyboard for a real one, which will have the added bonus of no longer having to adjust when switching from typing at home to typing at work.

Anyway, emacs and lisp. So on to lisp, I first downloaded slime for emacs, and after including the following short lisp snippet in my .emacs file tried to launch it:


(add-to-list 'load-path "/home//slime-2.0")
(require 'slime)
(setq inferior-lisp-program "clisp")
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)
(local-set-key "\r" 'newline-and-indent)
(setq lisp-indent-function 'common-lisp-indent-function)
(setq indent-tabs-mode nil)))


Obviously, no clisp could be found since I'd been dumb enough to not install it first. So on to the next step of installing lisp. Now, my first version of my .emacs file did not refer to clisp, rather it refered to lisp as I was following the short tutorial on unmutual.info and had chosen to use CMU Common Lisp. Right, so how to install CMU Common Lisp on my Ubuntu install, I visited the CMU Common Lisp website but then decided I'd rather use the synaptic packet manager. After a search for "lisp" presented me with a huge list of packages to install, I spent a good 10 minutes just skimming through them all untill I finally settled for the clisp package. A brief few seconds later, clisp and it's dependencies were installed and all I had to do was to edit my .emacs file to update my inferior-lisp-program from "lisp" to "clisp". Restart emacs, M-x slime, a quick compile and tada, slime ! Cool, now I just have 20% of emacs TUTORIAL and Paul Graham's "On Lisp" left to digest.