Bill Lovett

Installing Emacs from CVS into your Home Directory

Posted on October 3rd, 2006

I've been spending a lot of time customizing Emacs recently, with the help of Learning GNU Emacs from O'Reilly and the Emacs Wiki. One of the biggest improvements I made to my original setup, which consisted of using the default version of Emacs provided by whatever server I happened to be on, was to compile the latest version from CVS. But what's the best place to put it?

One obvious choice would be /usr/local, since it's meant to be the home for software you install yourself. That's all well and good for your own servers, but not so great when you're on someone else's. For example, I host my website through Dreamhost and installing your own junk into /usr/local/ is not allowed.

The trouble with the use-whatever-version-is-available philosophy is that you always have to keep in mind the lowest common denominator. I found this out the hard way when older versions of Emacs like the one available on Dreamhost's servers started spitting out errors at startup because I was using settings and features that were only available in the newest version. That's really annoying. And it would be equally annoying to have to litter your .emacs file with version tests-- who wants to bother with keeping track of which versions are compatible with which features?

My solution is to install Emacs into my home directory. Here's how I did it:

$ mkdir -p ~/local/src
$ cd ~/local/src
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs \
co emacs
$ cd emacs
$ ./configure --prefix=$HOME/local \
--disable-locallisppath \
--without-sound \
--with-x-toolkit=no \
--without-x
$ make bootstrap
$ make
$ make install

The make bootstrap command takes a long time, and would not complete successfully on Dreamhost's server. No idea why. Having everything under ~/local made it simple enough to copy the directory as a whole though. The Emacs I had complied on my home machine worked just fine on the remote server.

The advantage of this approach is that you can standardize on a single version of Emacs without disrupting the rest of your server's environment. You can have your preferred version installed in your preferred location, and other users can use the system-wide version. Then you can focus on doing whatever it is you use Emacs for in the first place.

Back to the index of all blog entries