0

I have a "UK-English International Macintosh" keyboard, and I use the accent shortcuts quite heavily since I'm French (AZERTY is terrible for programming).

Like option+e for ´, option+` for ``, etc

Is there a way to make Emacs completely ignore the command key, and change the meta key to something other than option ? (pretty much every key has an additional character when used with option)

I can't really use it like this, those shortcuts are too important.

1 Answer 1

3

You're looking for the following two user settings. I think you want at least ns-alternate-modifier none.

ns-alternate-modifier is a variable defined in `C source code'.

Its value is `super'
Original value was `meta'

This variable describes the behavior of the alternate or option key.
Either SYMBOL, describing the behavior for any event,
or (:ordinary SYMBOL :function SYMBOL :mouse SYMBOL), describing behavior
separately for ordinary keys, function keys, and mouse events.

Each SYMBOL is `control', `meta', `alt', `super', `hyper' or `none'.
If `none', the key is ignored by Emacs and retains its standard meaning.

And:

ns-command-modifier is a variable defined in `C source code'.

Its value is `control'
Original value was `super'

This variable describes the behavior of the command key.
Either SYMBOL, describing the behavior for any event,
or (:ordinary SYMBOL :function SYMBOL :mouse SYMBOL), describing behavior
separately for ordinary keys, function keys, and mouse events.

Each SYMBOL is `control', `meta', `alt', `super', `hyper' or `none'.
If `none', the key is ignored by Emacs and retains its standard meaning.

(there's also ns-control-modifier and ns-right-* variants if you only want to affect the key on the right hand side of the keyboard, and all of them have aliases starting with mac- instead of ns-)

2
  • Upvoted, will try once I'm back home and accept if this solves the problem (which I think it likely will).
    – ice-wind
    Nov 18, 2022 at 14:54
  • Accepting with one caveat : Those variables have aliases that I think are more helpful, namely mac-option-modifier and mac-command-modifier. I ended up using (setq mac-right-option-modifier 'none') so that my right option key can be used for accenting, and my left option key for emacs's meta key.
    – ice-wind
    Nov 19, 2022 at 14:20

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.