As always, I like building Emacs for my Mac from source. It lets me live on the cutting edge and have tigher control of the version I’m running. If building software from source isn’t your thing then skip the rest of this article and consider installing Emacs using Homebrew, MacPorts, or Fink
I’ve written about building Emacs in the past, but OS X Lion brings a few complexities to the process.
Before you begin you’ll need to have Xcode installed (free in the App Store).
In the past the best way to get the Emacs source was with CVS, but CVS is no longer included with Xcode. Fortunately, you can now use Git instead.
At this point you have two choices, you can build the current stable version of Emacs, 23.3, which requires a patch to work with Lion. Or you can build the development version, 24.0, which has support for Lion, but requires a couple of extra tools.
First Emacs 23.3. The master branch of the repository is the 24.0 development branch. The stable 23.3 branch is called emacs-23. Check that out with:
Then use curl apply the patch found in this Gist:
Now Emacs 23.3 can be built and installed:
Drag nextstep/Emacs.app to you Applications folder and you’re good to go. (The “install” step doen’t install anything, it builds the .app wrapper.)
If you want the future of Emacs today, you can build 24.0 instead. However, 24.0 requires newer versions of Autoconf and Automake than the ones shipped with Xcode 4.1.1. We’ll need to install those versions:
1 2 3 4 5 6 7
1 2 3 4 5 6 7
These will be installed in /usr/local/bin, so make sure you have that first in your PATH:
Now build Emacs as follows:
1 2 3 4 5
It’s a bit of work, but anytime there is an update I can simply:
then re-config and rebuild to have it on my system.