Search code examples
cocoaemacsinternationalizationnon-ascii-characterstty

Option key in Cocoa Emacs not entering accented characters


Using an international keyboard with TTY emacs works fine for entering characters:

alt-e + a enters á
alt-i + a enters â
etc

The problem is that in Cocoa Emacs that same doesn't hold true. These keys get interpreted as emacs commands.

I tried to unbind these keys globally, even unbinded they don't enter the correct escape character needed for international accented characters.

How to I get back to the TTY behaviour in Cocoa Emacs?


Solution

  • I like to have the best of both worlds on OSX, so I set the left alt/option key to META and the right alt/option key to the default native OSX settings. Here are my settings for the commonly used Emacs modifier keys:

    (setq ns-alternate-modifier 'meta)
    (setq ns-right-alternate-modifier 'none)
    (setq ns-command-modifier 'super)
    (setq ns-right-command-modifier 'left)
    (setq ns-control-modifier 'control)
    (setq ns-right-control-modifier 'left)
    (setq ns-function-modifier 'none)