I have a Windows keyboard (MS natural 4K), I'm using Mac OS X, and I like to use Emacs. However, the default Mac OS X GUI build for Emacs has the Windows key mapped to Meta (meta typically is the Alt key). This is not very comfortable, and I would like to remap it. Note that in the rest of my environment, Alt is really alt, and the Windows key typically shows up as the Apple key.


(setq mac-command-modifier 'alt) ;; Can be set to  meta, alt, super, or hyper

I'm not sure how your windows keys map, but you can evaluate that expression in a scratch buffer with C-x C-e until you find modifier you like and then copy it to your init.el or .emacs file.

  • Ah, but the problem is alt is not showing up as a meta key. Aug 4 '09 at 16:13
  • well, I think one of the problems is that in Emacs older than version 23, Alt (Option) was not Meta on the Macintosh out of the box. I don't have a windows keyboard to test, but have you tried all of the possible values for mac-command-modifier (meta, alt, super, or hyper)? With 'alt Meta is Option (alt) on my Mac keyboard. With 'meta it is Command. With 'super it is also Option (alt). With 'hyper it is Option (alt) again. It is likely to be different on your system, but one should work. Aug 4 '09 at 16:26
  • Ahh, I'm using emacs 22, I'm pretty sure. Aug 4 '09 at 17:22

Installing Emacs 23 solved this problem. Thank you, Richard Hoskins, for giving me the push to get Emacs 23.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.