January 2, 2010

Emacs tip: Don’t poke the bear.

Here’s a quick tip on how to set the meta-key on Mac versions of emacs.

(setq mac-option-modifier ‘meta)

I was on a witch-hunt the other day to update my Terminal.app settings to be able to use the Command key (aka pretzel, apple) as Meta to match my gui version of Emacs (Carbon Emacs). Mainly, this would keep me from going insane if I use Emacs over ssh, or in a terminal for a quick edit. What I found was that it was much, much easier to change Carbon Emacs to use option as Meta to match the Terminal.app settings. Terminal teases you with the “use Option as Meta” checkbox, but no “use Command as Meta”. The reason is very likely because the Command key is so engrained in OS X for all of it’s standard key-combos. Long story short, don’t poke the bear.

I still have some muscle memory retraining to do, since the command seems to make Option an additional Meta for Carbon Emacs, rather than replacing Command. But, I guess I can’t have everything.

Credit goes to a comment from serverfault.

Comments
blog comments powered by Disqus