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:

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>