Sunday, August 10, 2008

Howto install Emacs snapshot (v23.x)

It's another 3:00am.
I am an emacs advocate. I used vim enough, and still use vim for certain circumstances. However, I use emacs mainly for development.
Stable version of Emacs is v22. v23 is development tree. There is one big advantage compiling emacs v23. "xft" support. So, if you want to use 'Consolas' font in emacs, using v23 will simplify a lot. Configure switch is:

# ./configure --with-x-toolkit=gtk --enable-font-backend --with-xft \
--prefix=/usr/local/emacs-snapshot --with-tiff=no

It requires gtk.h. So, you need gtk2-devel package for Fedora Core. (Other distro like Ubuntu should not be a problem to find equivalent package. ) Then,

# make bootstrap
# make install

Then, add following line to use Consolas font.
(set-default-font "Consolas-11")

Simple enough. :)

Now, for people who didn't read README, like me, here is some quarks.
If you happened to execute 'make' before 'make bootstrap', you may run into a problem. (might be different problems, depending on revision). In my case, I cvs up and just issued "make" assuming that previous config information would be transparent. Not really. The top most error was:

"faces.el:29:13:Error: Symbol's function definition is void: cl-compile-time-init"

That line is (require 'cl). If you open Makefile, you will see that "make" and "make bootstrap" targets are different. In this case, somehow cl(common lisp) package was not ready when faces.el was compiling. According to Makefile, make bootstrap will 'force clean and bootstrap from a clean state' My assumption was partially right, but Makefile case did not cover my case, yet. Went through several seg-fault and compiled on my own and made it to work.

I believe that the easiest way was to "make clean" and start from scratch :)