You have probably heard by now, but Emacs 29.1 has been released! Here are some reasons to upgrade and how to do so right away if you are running Ubuntu 22.04 LTS.

What’s New with Emacs?

One of the most exciting new features for me is TreeSitter support, which provides incremental parsing capabilities for programming languages and other formatted files. This means that programming support will be getting faster, more comprehensive, and even better in future Emacs packages.

Other new features include native WebP image support, pure GTK support, and the ability to use emacs -x in the first line of a script, which could lead to some fun applications of Emacs Lisp. Read all of the release notes here!

Installing on Ubuntu 22.04 LTS

I am too impatient to wait for somebody to release a packaged version, so I installed Emacs 29.1 from source. It is fairly straightforward, though you will need to do a couple of special things to get all of the features you want.

Installing the Requirements

Note: All of the commands in this post assume you are using bash.

Most of the extra libraries and packages you will need to build Emacs 29.1 are covered in the build dependencies for the stock Emacs package. However, to take advantage of some of the cool extra features now included in Emacs, you’ll need to install a few more things.

sudo apt build-dep emacs
sudo apt install libgccjit0 libgccjit-10-dev libjansson4 libjansson-dev \
    gnutls-bin libtree-sitter-dev gcc-10 imagemagick libmagick++-dev \
    libwebp-dev webp libxft-dev libxft2

Preparing to Build

In order to get native compilation (a feature added in Emacs 28) working correctly, you will need to make sure your shell instructs the build system to use gcc-10.

export CC=/usr/bin/gcc-10
export CXX=/usr/bin/gcc-10

Get the Source Code and Let’s Compile!

Download the Emacs 29.1 source code from a nearby GNU mirror and then extract it! Then follow the instructions below. Note that you might want to take a closer look at the options to ./configure. If you want native compilation, but don’t want to use the “ahead of time” option because it’s slow, you can remove the =aot. You might also want to stick Emacs in a different location using the --prefix option. For example, I used --prefix=/opt/emacs29.

cd emacs-29.1
./autogen.sh
./configure --with-native-compilation=aot --with-imagemagick --with-json \
    --with-tree-sitter --with-xft
make -j$(nproc)

The build might take a while. With the “ahead of time” compilation, I think my build took ten or fifteen minutes. But once it is complete, try running your new Emacs binary to make sure it works.

./src/emacs -Q

If it works, install it!

make install

What’s Next

You’ve got Emacs 29.1 installed and running! This is exciting. Which new features do you want to try first?

I hope this article was helpful, and that you are enjoying the latest version of Emacs! I used it to write this blog post, so you know I am.