Installing Emacs 23 on Mac OS X
Update, July 31, 2009: Emacs 23 is now officially released. These instructions still apply, but the flags have changed slightly since I first wrote this entry. I've updated the text below to apply to the official Emacs 23 release, checked out from CVS.
I've mentioned using the Emacs text editor with Mac OS X several times over the years. Carbon Emacs and Aquamacs are both fine ready-to-run bundles with neat integration with the Mac operating system and visual style. As of Emacs 22, plain ol' GNU Emacs works just fine as a Mac native application (no Terminal or X11 server required). I mentioned how to download and build your own Emacs 22 a while ago, and have since used that post as reference when I needed to remember how.
Emacs 22 has long since been, and still is, the official stable release is no longer the official stable release. Of course, this means the Emacs die-hards have all moved on to Emacs 23, which you can get from GNU's CVS repository as before. Emacs 23 is now the official stable release. You can still get it from the CVS repository and build it yourself for Mac OS X. However, the Mac OS X build instructions have changed slightly since Emacs 22, and if you use my old instructions you get an Emacs.app that complains, "You can't open the application "Emacs.app" because it is not supported on this architecture." So it's time for a new entry.
To build Emacs 23 for Mac OS X:
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs cd emacs ./configure --with-ns --with-jpeg=no --with-gif=no --with-tiff=no make bootstrap make make install sudo cp -r nextstep/Emacs.app /Applications/Emacs.app
Notes:
- To build software, you need to install the XCode developer tools that came with your Mac OS X installation discs.
- The
--with-nsconfiguration option is required to build a NextStep binary, which is the Mac OS X binary. - I've included
--with-jpeg=no --with-gif=no --with-tiff=nobecause my developer tools lack those libraries, yours probably do too, and I'm too lazy to find them and install them. Maybe I'll come back and amend these instructions to include these features someday. (Feel free to post them in comments!) Until then, this Emacs build will lack support for viewing images in these formats. - The last
sudo cp ...command simply installs Emacs.app into the Applications folder. Notice that it comes from thenextstepdirectory, not themacdirectory. - Update July 31, 2009:
--enable-carbon-appis no longer necessary. - Update July 31, 2009:
sudois no longer required formake install, because the install isn't actually installing, it's just assembling the application bundle in the build directory.
I'm not a part of the Emacs development community so I can't explain these changes, but I'm glad to have found them.
If you don't want to build Emacs yourself, still want to use a vanilla Emacs instead of a bundle, and don't mind getting builds from some guy on the Internet, EmacsForMacOSX.com has easy-to-install downloads for the latest stable version and previous versions of Emacs, as well as nightly CVS snapshots of the development version.
./configure --enable-carbon-app --with-ns --with-jpeg=no --with-gif=no --with-tiff=no
configure: WARNING: Unrecognized options: --enable-carbon-app
I just checked out my emacs from cvs, as instructed above.