SaltyCrane Blog — Notes on JavaScript and web development

Installing Emacs 23 from CVSBazaar source on Ubuntu HardyKarmic

I have been using the emacs-snapshot package in Ubuntu Hardy. However, when I tried to use Tramp, I got an error message: Variable binding depth exceeds max-specpdl-size. I couldn't find out how to fix this, and I didn't want to use Emacs 22.3 because it doesn't have Xft (anti-aliased fonts), so I decided to live on the bleeding edge and install Emacs 23 from CVS. Besides the INSTALL and INSTALL.CVS files, I also used theBlackDragon's article for reference.

Update 2008-10-09: I just found that Romain Francoise maintains an emacs-snapshot Debian package and it has been adapted for Ubuntu. This is an alternative to installing from source.

Update 2010-01-09: Since Emacs has switched from CVS to Bazaar, I've updated these instructions to use Bazaar. Also, I'm now running on Ubuntu 9.10 Karmic Koala instead of Ubuntu Hardy.

Update 2012-09-19: Here are some additional Ubuntu 12.04 packages I needed to install Emacs 24.2.

$ sudo apt-get install libgif-dev
$ sudo apt-get install libtiff4-dev
$ sudo apt-get install xaw3dg-dev
$ sudo apt-get install librsvg2-dev
$ sudo apt-get install libmagick++-dev
$ sudo apt-get install libgpm-dev
$ sudo apt-get install libgconf2-dev
$ sudo apt-get install libselinux1-dev
$ sudo apt-get install libm17n-dev
$ sudo apt-get install libotf-dev 
  • Install Bazaar
    $ sudo apt-get install bzr
  • Get the source code from the Bazaar repository
    $ cd ~/incoming
    $ bzr branch emacs_trunk
  • Read the INSTALL and INSTALL.BZR files in ~/incoming/emacs_trunk

  • Install prerequisites:
    $ sudo apt-get install build-essential
    $ sudo apt-get build-dep emacs23

    To see what is installed by build-dep, see the emacs23 karmic package page

  • Configure. The argument --prefix=/home/saltycrane/lib/emacs-bzr-20100210 means I am installing Emacs in /home/saltycrane/lib/emacs-bzr-20100210.
    $ cd ~/incoming/emacs_trunk
    $ ./configure --prefix=/home/saltycrane/lib/emacs-bzr-20100210
  • Per the INSTALL.BZR file, I needed to do a make bootstrap instead of make because some files, such as byte-compiled lisp files are not stored in Bazaar. Note, this takes a long time (over 10 min for me).
    $ make bootstrap
  • Make (Optional)
    $ make
  • Test it (Optional)
    $ src/emacs -q
  • Install
    $ make install
  • Create symlinks (~/bin is already on my PATH)
    $ ln -s ~/lib/emacs-bzr-20100210 ~/lib/emacs
    $ cd ~/bin
    $ ln -s ../lib/emacs/bin/* .

    Alternatively, I could add ~/lib/emacs-bzr-20100210/bin to my PATH.

Now I have "Pretty Emacs" with working Tramp for remote file access. It also has multi-tty support which is supposed to be very cool (but I haven't tried it yet) is very cool (e.g. for displaying my running desktop emacs process on my Android phone.)

Error messages
  • configure: error: You do not seem to have makeinfo >= 4.6, and your
    source tree does not seem to have pre-built manuals in the `info' directory.
    Either install a suitable version of makeinfo, or re-run configure
    with the `--without-makeinfo' option to build without the manuals.
    $ sudo apt-get install texinfo
  • configure: error: The following required libraries were not found:
         libjpeg libgif/libungif libtiff
    Maybe some development libraries/packages are missing?
    If you don't want to link with them give
         --with-jpeg=no --with-gif=no --with-tiff=no
    as options to configure
    $ sudo apt-get install libjpeg-dev libgif-dev libtiff4-dev
  • Warning: arch-dependent data dir (/home/saltycrane/lib/emacs-bzr/libexec/emacs/23.1.92/i686-pc-linux-gnu/) does not exist.
    Warning: Lisp directory `/home/saltycrane/lib/emacs-bzr/share/emacs/23.1.92/site-lisp' does not exist.
    Warning: Lisp directory `/home/saltycrane/lib/emacs-bzr/share/emacs/site-lisp' does not exist.
    Warning: Lisp directory `/home/saltycrane/lib/emacs-bzr/share/emacs/23.1.92/lisp' does not exist.
    Warning: Lisp directory `/home/saltycrane/lib/emacs-bzr/share/emacs/23.1.92/leim' does not exist.
    Warning: Could not find simple.el nor simple.elc

    This happened because I originally used ./configure --prefix=/home/saltycrane/lib/emacs-bzr and then renamed ~/lib/emacs-bzr to ~/lib/emacs-bzr-20100210. Solution: don't rename the directory.


#1 vedang commented on :

Just giving you a thumbs up for this article :). Used it to successfully set-up the cvs version of emacs. Thanks!

#2 Richard commented on :

Thanks for this post! Steps work perfectly -- just did this on 9.04 (Jaunty Jackalope).

#3 Crackcell commented on :

really nice. Thank you!

#4 Johan commented on :

I ran into the same max-specpdl-size error message. It turned out that it was caused by elisp libraries that i load from .emacs that i have compiled in emacs22. The byte-code format seem to have changed. When i removed those elc files the error disappeared.

#5 Eliot commented on :

Johan, Thanks very much for explaining the cause of the max-specpdl-size error. I had googled it and couldn't find a solution.

#6 Mamat Dnky commented on :

I've encountered the error before, while debugging my own elisp codes.

I don't know whether this would ideally solve the issue, but the max can be actually increased to a higher value, for eg, 4000 . (setq max-specpdl-size 4000)

Perhaps current max value should be initially checked first: M-x describe-variable RET max-specpdl-size RET

#7 Eliot commented on :

Test comment. Comments on this site seem to be giving me problems. Should I switch to Disqus?

#8 dericbytes commented on :



$ sudo apt-get install build-essential
$ sudo apt-get build-dep emacs23

when installing the emacs24 source.