3

At work I use a MacMini connected to an italian layout keyboard (please, look at the image) enter image description here

I've discovered that Emacs doesn't insert the characters @ and # when I use AltGr+ò and AltGr+à, respectively.

Any clue?

Drew
  • 75,699
  • 9
  • 109
  • 225
Daniele
  • 637
  • 1
  • 5
  • 14
  • 2
    Try `C-h k AltGr-ò` to determine what emacs receives. Maybe you can bind that to the required character by `(global-set-key [...] (lambda () (interactive) "@"))`. – Tobias Nov 29 '17 at 14:59
  • M-ò is undefined M-à is undefined – Daniele Nov 30 '17 at 10:33
  • I don't have experience with Mac OS. Maybe, the solution of matteol is the way to go. If for any reason that is not possible for you my next best guess would be to use `(global-set-key (kbd "M-ò") (lambda () (interactive) "@"))`. – Tobias Nov 30 '17 at 20:46
  • I've updated my answer with a configuration that let you use the left Alt as Meta and the right one to insert special characters – matteol Dec 02 '17 at 15:30

1 Answers1

3

I have the following in my init.el to use the italian layout with Mac OS

;; Command key is Meta
(setq ns-command-modifier 'meta)
;; Option (alt) key used for special characters (e.g. []@#{}...)
(setq ns-alternate-modifier nil)

If you want to use the left Alt key as Meta and the right one to insert special characters you can set the following

;; AltGr used for special characters (e.g. []@#{}...)
(setq ns-right-alternate-modifier nil)

leaving the default values for ns-command-modifier and ns-alternate-modifier.

matteol
  • 1,868
  • 1
  • 9
  • 11