A 2007 look at Emacs on MacOSX Tiger/Leopard
Feb 11, 2007
April 7, 2007 (updated)
As a Linux person working on macs now, one of the tools I have been missing
over the years is a real xemacs editor. The emacs that Apple shipped with
Tiger only worked in the terminal window, and I found that to be .. too 1989.
I need an editor with windows, something where the mouse works, and how about
cut & paste between apps? That would make me happy.
The history and landscape of the current state of Emacs on MacOSX is a little
confusing. From what I can tell, a lot of the heavy lifting to give Emacs a
facelift on the mac was done by Andrew Choi in the 2001-2003 time period. These changes landed in the GNU version of Emacs; these also made it to the xemacs version a few years later in 2005, but xemacs.org says these changes are still "experimental". Here is the XEmacs side of the XEmacs/GNU Emacs disagreements. Come on guys, can't we all just get along already.
Sorting out the confusion
Anyways, here are the versions that I took a look at:
- GNU Emacs
The original drop of achoi's code landed here and seems to work pretty well. Building the mac support in this version is called Carbon Emacs. This code can be downloaded via cvs:
setenv CVSROOT :pserver:anonymous@cvs.sv.gnu.org:/sources/emacs
cvs login [anonymous]
cvs co emacs
Read the mac/INSTALL file to build this for osx. The default Carbon-build behavior is to install emacs in /usr/local/* and install an Emacs.app in /Application
./configure --enable-carbon-app
make bootstrap
make
sudo make install
There is another option (the one I wanted): build a self-contained Emacs.app and package it in a .dmg form so you can re-install this on other machines later. This build worked-for-me fine on 10.4.9 i386 & ppc. The incantation for this is
cd mac
./make-package --self-contained -c,--enable-carbon-app
I have saved off ppc & i386 versions of this installer, you are welcome to try it. This the trunk of emacs, the about emacs says "This is GNU Emacs 22.0.93.1 (i386-apple-darwin8.8.1, Carbon Version 1.6.0) of 2007-02-10". These packages install as /Applications/Emacs.app; you can also start emacs up from Terminal via /Applications/Emacs.app/Contents/MacOS/Emacs.
Download:
Also note I have both of these packages installed on recent (April 2007) Developer versions of Leopard, ppc & i386, and they seem to work fine there.
- XEmacs
Folded achoi's 2003 changes in or around 2005, and ? not totally done yet. Building this mac support is called Carbon XEmacs. This code can be downloaded by cvs/tar file.
- Aquamacs
Mac-customized version of GNU emacs, by David Reitter. This adds better font support, Mac cut & paste clipboard support, and is available in binary or cvs download form.
- Emacs for MacOS X
This looks like a one-off compile of achoi's work on the GNU branch. This looks like a 2002 version, it probably works but ? it may be old.
Getting the GNU build of Carbon Emacs to work right
After considering all of this, I decided to try the GNU flavor of Carbon Emacs. The version I have included for download above works for me, except mac cut & paste clipboard has been mapped to the yank/kill emacs behavior. Command-c copy in one app needs a ? ctrl-y yank in emacs. I found this confusing, command-v should just paste here. Unfortunately emacs default maps the command key to Meta. You used to turn this off with:
(setq mac-command-key-is-meta 'nil)
but this variable has been retired recently, instead you need to use `mac-command-modifier' and `mac-option-modifier' to change the default behavior. Here is the .emacs fu that I figured out to map command-[xcv] to the proper yank/kill commands:
; map command key to alt
(setq mac-command-modifier 'alt)
; Map command-x,c,v to cut, copy, paste
(global-set-key [?\A-x] 'clipboard-kill-region)
(global-set-key [?\A-c] 'clipboard-kill-ring-save)
(global-set-key [?\A-v] 'clipboard-yank)
; More mac shortcuts.
(global-set-key [?\A-a] 'mark-whole-buffer)
(global-set-key [?\A-z] 'undo)
(global-set-key [?\A-l] 'goto-line)
(global-set-key [?\A-m] 'iconify-frame)
(global-set-key [?\A-n] 'new-frame)
This seems to work pretty well. To start the UI version up from a Terminal:
/Application/Emacs.app/Contents/MacOS/Emacs
Please send me comments or suggestions about how to keep all these versions straight and what the best solution is. I haven't looked much at XEmacs or AquaEmacs, I would like to learn more about experiences with those two apps.
Chris McAfee <mcafee@mocha.com>