May 08, 2005

Mac OS X Tiger Emacs Incompatibilities

I just upgraded to Mac OS X Tiger (10.4), and unfortunately this killed my Emacs setup.

Carbon Emacs has stopped working, as has DoubleCommand, which I had been using to remap my PowerBook's enter key to ctrl (I'm completely lost in Emacs without this).

To fix the general Emacs problem, I've replaced Carbon Emacs with John Wiseman's Aqua build of Emacs, available via Dan Moniz here. Looks pretty sexy.

Unfortunately at the time of writing there is no Tiger-compatible version of DoubleCommand, nor the equivalent uControl.

Emacs is dead to me without a right ctrl key, and I use Emacs a lot.

I read Technote TN2056, but it mentions nothing about how to remap modifier keys.

Does anyone know of a general way to remap modifier functions (ctrl, option, cmd, shift, etc.) to other keys under Mac OS X?

In the meantime I'm offering my services to both the uControl and DoubleCommand projects to help get them ported to Tiger. I just wish that I knew more about Mach Kernel hacking...

UPDATE 5/26/2005:

The MacOS X 10.4.1 update kills the Aqua Emacs build that I linked to above. Once again, Dan Moniz has an updated version.

As far as remapping the enter key goes, I've been been participating in the uControl mailing list. Owing to the fact that Apple has added the ability to remap the caps lock key to control in the OS, uControl's maintainer, Shane Cells, has retired. Development appears to have stopped for the foreseeable future.

Heiko Hellweg has instructions for remapping the enter key on ADB keyboards. Unfortunately this does not work with newer Powerbooks (like mine) which use a USB keyboard.

I recommend heading over to http://bugreport.apple.com to file a feature request for the ability to remap the enter key so that hopefully this problem will be officially solved in the future.

UPDATE 7/28/2005:

See my comment below for information on using Emacs under X11 with the enter key remapped.

UPDATE 8/23/2005:

We finally have keyboard remapping utilities for Mac OS X 10.4!

In Technology and Software

Posted by Josh Staiger at 04:37 PM

Comments

In the Keyboard and Mouse system preferences under the Keyboard tab there is a button that brings up a sheet for remapping caps-lock, control, option, and command.

Posted by: Jason Marr May 8, 2005 05:05 PM | Permanent link

Ah, yes, but this won't allow me to map a modifier function to a key that isn't on that list (specifically the 'ctrl' function to the 'enter' key).

I'll update my question to be a bit more specific.

What I'm really looking for is something akin to the loadkeys command on linux (see here). As far as I can tell, an equivalent doesn't exist for Mac, unfortunately.

Posted by: Josh Staiger May 8, 2005 05:26 PM | Permanent link

Josh,

Two things:

1. The lastest version of the Emacs cvs builds and runs fine on Tiger (10.4 -> 10.4.2). For build instructions see:
http://members.shaw.ca/akochoi-emacs/stories/obtaining-and-building.html

2. In Carbon Emacs You can reverse the ctrl and meta keys by setting "mac-reverse-ctrl-meta" to non-nil in your .emacs file. Since there is a RHS command key this might be what you need?

John

Posted by: John Buckley July 26, 2005 10:24 AM | Permanent link

Hi Jon,

Thanks for the heads up on Carbon Emacs.

Unfortunately the "mac-reverse-ctrl-meta" flag won't work for me because I use the right meta key just as much as I use th right ctrl key.

Lately I've taken to using Emacs under X11 and remapping the enter key to ctrl using xmodmap.

This can be done by placing the following into a text file:

keycode 60 = Control_R
add Control = Control_R

And running xmodmap on this file from an X11 terminal.

It's not a perfect solution, as running apps under X11 is not nearly as seemless as running native Mac OS apps (for instance, I have issues with cmd+tab, and cut/copy/paste/yank between X11 Emacs and non-X11 apps), but it's been enough to hold me over until a new keyboard remapping extension appears for Tiger.

Luckily, it appears that such extensions are on the way, and I plan on writing about this shortly.

Posted by: Josh Staiger July 28, 2005 05:28 AM | Permanent link

As for Emacs with remappable modifier keys (Meta, etc.), you might like Aquamacs, http://aquamacs.org.

Posted by: David September 30, 2005 02:31 PM | Permanent link