This page is a collection of Emacs related notes. The From Scratch to Emacs, The Adventurous Configurator’s Handbook page contains a step-by-step guide to configure Emacs from scratch.
Notes on Emacs
My current flavour/distribution of Emacs is
DOOM Emacs spacemacs1 DOOM Emacs2.
Yes, DOOM Emacs is my preferred configuration framework at the moment. I have used Spacemacs for a long time, but the performance increase by switching to DOOM Emacs is simply to great to be ignored.
Recently, I have also migrated to the Emacs 28 branch which includes Elisp native compilation. It is a thing of beauty in terms of speed.
This page refers to broad Emacs base configuration. For specific Emacs recipes check the Emacs cookbook.
Many people swear by
emacs-mac as the gold standard for macOS Emacs distributions.
To install it, using
homebrew simply run
$ brew tap railwaycat/emacsmacport $ brew install --cask emacs-mac-spacemacs-icon
emacs-mac is, at the time of writing, targetting Emacs 27. If you want to use Emacs 29 (and don’t want to build it from source) a good option is
emacs-plus. To install it use:
$ brew install emacs-plus@28 \ --with-native-comp \ --with-modern-doom3-icon \ --with-mailutils \ --with-imagemagick
Another option is to use
jimeh’s Emacs builds3. These include nightly builds of Emacs 28 with native compilation enabled. To install it, simply run
brew install --cask emacs-app
or, if want the latest nightly build from Emacs’ master branch:
brew install --cask emacs-app-nightly
$ sudo port install emacs
At the time of writing6, Fedora only supports, officially, Emacs 27. If you want to try Emacs 28 (and the native compilation feature) you need to install it using
$ sudo dnf copr enable deathwish/emacs-pgtk-nativecomp
and then (if Emacs is already present)
$ sudo dnf upgrade emacs
$ sudo dnf install emacs
$ sudo snap install emacs --edge --classic
In December 2021 the
pgtk branch of Emacs was merged into master7.
Among other features this adds full Wayland support and better font rendering for the Emacs GUI.
This version can be compiled from source with just a few simple steps.
To build this version in Linux (I’m assuming Ubuntu and variants) you will need the following dependencies:
libgtk-3-dev, Gnome dependencies
libxpm-devprovide image support
libncurses-dev, provides terminal support
libxml2-devfor XML support
I also wanted to include Emacs’ native JSON support and Elisp native compilation, so will additionally need:
libjansson-dev, provides native JSON support
A one-liner to install all dependencies is:
$ sudo apt update $ sudo apt install build-essential libgtk-3-dev libgnutls28-dev \ libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev \ libncurses-dev texinfo \ libxml2-dev \ jansson4 libjansson-dev \ libgccjit0 libgccjit-11-dev gcc-11 g++-11
If building on Fedora, the dependency names will naturally be slightly different. In this case we would use
$ sudo dnf update $ sudo dnf install @development-tools autoconf \ gtk3-devel gnutls-devel \ libtiff-devel giflib-devel libjpeg-devel libpng-devel libXpm-devel \ ncurses-devel texinfo \ libxml2-devel \ jansson jansson-devel \ libgccjit libgccjit-devel
We can then clone the Emacs repo and run
autogen. The steps from now on should be the same for most GNU/Linux distributions.
$ git clone git://git.sv.gnu.org/emacs.git $ cd emacs $ ./autogen.sh
To use native Elisp compilation we will use
gcc-118 so before starting the build run:
$ export CC=/usr/bin/gcc-11 CXX=/usr/bin/gcc-11
On Fedora, if are sure you have
gcc 11, simply export
$ export CC=/usr/bin/gcc CXX=/usr/bin/gcc
--with-xxx to enable support for feature
xxx, which in our case will be:
--with-pgtk, native GTK support
--with-json, native JSON support
--with-native-compilation, native compilation support
--with-xml2, XML support
--with-modules, support for dynamic modules
--with-mailutils, support for
So we can run the configure script with
$ ./configure \ --with-native-compilation \ --with-json \ --with-pgtk \ --with-xml2 \ --with-modules \ --with-mailutils
We can now start the build and installation (you can choose the approriate number for your machine for the parallel run, in this case
$ make -j8 $ sudo make install
If everything completes successfully you should have Emacs 29 available in
$ emacs --version GNU Emacs 29.0.50 Copyright (C) 2021 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.
I recently move from
ivy. The main reason is that apparently
helm development has stalled.
The important stuff?
I’ve also made a vaporwave Emacs icon which you can find in [https://github.com/ruivieira/emacs-vaporwave-icon]here.
An excellent resource for Emacs themes is Peach MELPA. Some selected theme are below.
Here is a list of good themes for Emacs:
The theme that I’m currently using is
spacemacs-light. It works really well the new
A more detailed rundown of the specific theming can be found at DOOM Emacs.
- The main page for Elisp
- You can check my solutions for the Euler project in Elisp: Project Euler in Elisp
Running org files
Since Emacs 25.1, Emacs can use Dynamic Modules.
Fedora 32/33. ↩︎
Helmmaintainer is Thierry Volpiatto. ↩︎