I'm new to Emacs, and am using a Mac. I want the Mac command key to act as a control key for Emacs.

How do I do that? I tried (setq mac-command-modifier 'control).

Besides, how do I find key variable and local key names in Emacs? For example: how can I find that mac-command-modifier is the command key name?

  • It also might be useful to switch your control key and cap lock key to save you fingers all that stretching. Then you can just press cap locks to use emacs commands.
    – Robert
    Commented Sep 24, 2019 at 17:50

1 Answer 1


The EmacsWiki node on Emacs for Mac OS will give you advice on a number of OSX-specific issues. More specific to your question, you can adjust the modifier keys as you like:


Aside: you might see these as ns- in place of mac- in some places. The ns-, I believe, is referring to NeXTSTEP, one of the sources for OSX.

You should be fine with your setup to make Emacs interpret the command key as control:

(setq mac-command-modifier 'control)

Put that in your init file and it should take effect the next time you start Emacs.

For keybindings, the first stop is the Emacs manual node on Customizing Key Bindings. Another good resource is Mickey Petersen's Mastering Key Bindings in Emacs.

  • Thanks the document link. but for the problem, I'm saved the config and restart emacs,it not works for me. As for Option map to Meta same the problem, luckily, mac terminal can set Option to Meta with terminal preference setting. I doubt mac terminal can't simply change the key's map by setq sentence. Commented Aug 27, 2016 at 11:24
  • 1
    @LoranceChen: are you using Emacs with a terminal? Terminals have special problems in receiving certain key combinations.
    – Dan
    Commented Aug 27, 2016 at 13:45
  • Yes,its spawn on terminal.It seems I need download some GUI emacs. Commented Aug 27, 2016 at 14:36
  • @LoranceChen: for reference, see the discussion in Problems with keybindings when using terminal.
    – Dan
    Commented Aug 27, 2016 at 14:56
  • I'm don't want deep into the terminal like problem yet.At least, it should be notice at MacOS. Commented Aug 27, 2016 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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