Cipher Log

Chronicles in Language, Technology, and Law

Installing a minimal emacs on macOS

July 20, 2022

Sadly, the folks over at Homebrew have decided not to maintain the emacs-nox package, which gave us a nice Terminal-only emacs editor. I spent some time playing with configurations today and got it to build just the way I want it.

First, use Homebrew to install dependencies only, and then to fetch the source only. Then we're going to copy the source archive to our home folder, extract it, and configure it appropriately. Then we'll build it and install it.

If you copy and paste this (single, large, compound) command into the Terminal and press Enter, you'll end up with a nice text-only emacs installation at /usr/local/bin/emacs. You may have to enter your password for the installation part.

brew install --only-dependencies emacs && \ mv `brew fetch -sf emacs 2>&1 | awk -F\: '/Downloaded to/{print $(NF)}'` ~/emacs.tar.xz && \ tar xvf emacs.tar.xz && \ mv "$(find ~ -name "emacs*" -type d -amin -10 -maxdepth 1 -mindepth 1)" emacsbuild && \ cd emacsbuild && \ CC=/usr/bin/clang ./configure --disable-build-details \ --without-xpm \ --without-jpeg \ --without-tiff \ --without-gif \ --without-png \ --without-rsvg \ --without-lcms2 \ --without-libsystemd \ --without-cairo \ --without-native-image-api \ --without-xft \ --without-harfbuzz \ --without-libotf \ --without-m17n-flt \ --without-toolkit-scroll-bars \ --without-xaw3d \ --without-xim \ --without-xdbe \ --without-gpm \ --without-dbus \ --without-gsettings \ --without-selinux \ --without-libgmp \ --without-x \ --without-xwidgets \ --without-imagemagick \ --without-ns \ --with-xml2 \ --with-included-regex \ --prefix=/usr/local && \ make && \ sudo make install

If you also want a very fast and minimal emacs setup, run the following command to modify your preferences:

printf "(setq inhibit-splash-screen t)\n(setq initial-scratch-message \"\")\n(switch-to-buffer \"**\")\n\n" >> ~/.emacs

Labels: , ,

0 Comment(s)

Post a Comment