Installing Emacs

Releases

For sanity checking, it's helpful to have access to older versions of Emacs. We can download and verify a version like this:

#aria2c https://ftp.gnu.org/gnu/gnu-keyring.gpg -d /tmp/
#gpg --import /tmp/gnu-keyring.gpg
VERSION=24.2
aria2c https://ftp.gnu.org/gnu/emacs/emacs-${VERSION}.tar.xz.sig -d /tmp/
gpg --verify /tmp/emacs-${VERSION}.tar.xz.sig
aria2c https://ftp.gnu.org/gnu/emacs/emacs-${VERSION}.tar.xz -d /tmp/
tar -xf emacs-${VERSION}.tar.xz

Building from Source

First, clone the repo:

git clone https://git.savannah.gnu.org/git/emacs.git /tmp/emacs

Once the source is in hand, I stronly recommend making a separate build directory and calling the configure script from there.

mkdir /tmp/emacs-build && cd /tmp/emacs-build
../emacs/configure --with-mailutils --with-imagemagick --with-x-toolkit=athena --without-pop --without-sound --with-json --enable-link-time-optimization --with-native-compilation
NATIVE_FULL_AOT=1 make -j8
# test the build with './src/emacs' (location of output binary)
# install emacs binaries on current system
make install

The configure script takes a bunch of different flags that customize the build, and generate a build-specific Makefile.

The next line compiles the source. Install with make install and you're done! A custom Emacs binary with all the fixings has just been installed for your current user. :)

Here are some of the other configuration flags worth investigating:

  • –without-all
  • –with-x-toolkit=no
  • –without-x
  • –without-dbus –without-gconf –without-gsettings