1

I have an Italian keyboard layout. My left Alt/Option key does not behave as the Meta key in Emacs terminal (OS X), but it behaves as the Meta key in GNU Emacs (GUI) downloaded from https://emacsformacosx.com

How can I get my left Alt/Option key to act as Meta? It prints .

0

http://osxdaily.com/2013/02/01/use-option-as-meta-key-in-mac-os-x-terminal/

  1. Open Terminal and pull down the primary Terminal menu to choose “Preferences”
  2. Under the “Settings” section, find your default Terminal and click the “Keyboard” subsetting tab
  3. Check the little box for “Use option as meta key” at the bottom of the window
  • @junnu this does not work since I use right alt to press @#[] {} characters in the italian layout. If I bind option as meta as you suggested, these characters will not work. I ONLY need the left alt key as meta, the right should be left/option like now. – lllIIIlllIIIIIll Oct 19 '18 at 10:52
  • 2
    This is, I think, the right answer, but it might be a good idea to suggest using iTerm instead of Terminal.app as it lets you set the left and right option keys separately. – Alan Third Oct 19 '18 at 12:37
0

It sounds like your problem isn't with emacs but with your chosen keyboard layout on the Mac. The Mac lets you customize such things in enormous detail using XML keyboard layout files that you can load. I'd look in to doing that.

0

After making sure the right alt key is setup in the Terminal app as @junnu suggested, you can do the following to free up the right option key for the special characters you need:

(setq mac-right-option-modifier nil)

EDIT: Was a bit too quick, as I now read that you want to change the behaviour of the left option key...

Anyway, here is a suggestion: take a look at the variable ns-alternate-modifier and its documentation (with C-h v). What is this variable's value in your current configuration?


EDIT 2: As pointed out by Stefan, this only affects the GUI setup. This setting is part of ns-win.el and thus only loaded in a windowed environment.

  • 1
    All these options only affect the GUI case, not the case where Emacs is running inside a terminal. – Stefan Oct 19 '18 at 16:51

protected by Community Oct 19 '18 at 13:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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