Fork me on GitHub
#emacs
<
2021-04-23
>
kingcode15:04:18

I just upgraded macOS from High Sierra to Catalina, and Emacs from 25.1.1 to 27.2.2 and am experiencing a real Meta key headache: the Command key is no longer recognized as Meta, and I have to use the Option key instead. Has anyone come across this? Is there any way to fix this short of rebinding everything? I don’t want to remap macOS Cmd to Options key, which would break the Cmd key for non-Emacs usage. This seems to come from macOS change - any advice?

dpsutton15:04:47

terminal or gui?

dpsutton15:04:10

if gui i have the following:

(when personal/osx-p
  (setq mac-command-modifier 'meta))
might also work in terminal, not sure. i think iterm has a way to hijack that in the terminal emulator. and (defconst personal/osx-p (string= system-type "darwin")) is the osx-p predicate

kingcode15:04:15

Thanks @dpsutton, I can use either - I got a ‘Symbol’s value as variable is void’

eggsyntax15:04:53

& FYI there are similar ones for alt and hyper. From mine:

(setq mac-option-modifier 'alt)
(setq mac-command-modifier 'meta)
(setq mac-function-modifier 'hyper)
I believe those work for me in terminal as well.

kingcode15:04:30

Thanks @eggsyntax, this worked for both gui and term!

emacs 6
kingcode15:04:26

I was seeing a very dark horizon with this issue, and a possible return to vi - yikes 🙂

😅 3
kingcode15:04:57

I am shocked the online Gnu Emacs wiki doesn’t mention this…they more or less tell you to live with it.

kingcode15:04:11

Sorry for the mistake in attribution

dpsutton15:04:42

it might be because they are weird about osx. or perhaps the gurus who run that website use escape as their meta key. i've seen people do that and it is crazy to me

3
kingcode16:04:53

Indeed - since there are option keys on both sides I could get by for a while, but Escape then x in sequence?? Forget it…also, that seemed to completely go against the mantra of ‘make Emacs do want you want it to’. Thanks!

kingcode16:04:12

I have added a suggested change to the Emacs wiki https://www.emacswiki.org/emacs/EmacsWikiSuggestions#h5o-1

kingcode17:04:56

@dpsutton Your solution works also in both modes - sorry, I omitted to paste in the osx-p declaration! This is very handy for switching b/w hardware. Thanks!

kingcode17:04:53

Emacs is still great 🙂 !

eggsyntax19:04:19

> perhaps the gurus who run that website use escape as their meta key. i’ve seen people do that and it is crazy to me That’s ridiculous! You need the escape key to activate caps lock. 😉