index all rss twitter github linkedin email

Álvaro Ramírez

17 May 2021 Emacs plus –with-native-comp

brew-native-comp.png

I'm a big fan of Boris Buliga's Emacs Plus homebrew recipe for customizing and installing Emacs builds on macOS.

For a little while, I took a detour and built Emacs myself, so I could enable Andrea Corallo's fantastic native compilation. I documented the steps here. Though it was fairly straightforward, I did miss Emacs Plus's convenience.

I had been meaning to check back on Emacs Plus for native compilation support. Turns out, it was merged back in Dec 2020, and it works great!

Enabling native compilation is simple (just use –with-native-comp). As a bonus, you get all the Emacs Plus goodies. I'm loving –with-elrumo2-icon, enabling a spiffy icon to go with macOS Big Sur. –with-no-frame-refocus is also handy to avoid refocusing other frames when another one is closed.

In any case, here's the minimum needed to install Emacs Plus with native compilation support enabled:

brew tap d12frosted/emacs-plus
brew install emacs-plus@28 --with-native-comp

Sit tight. Homebrew will build and install some chunky dependencies (including gcc and libgccjit).

Note: Your init.el needs tweaking to take advantage of native compilation. See my previous post for how I set mine, or go straight to my config.