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?
terminal or gui?
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 predicateThanks @dpsutton, I can use either - I got a ‘Symbol’s value as variable is void’
& 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.Thanks @eggsyntax, this worked for both gui and term!
I was seeing a very dark horizon with this issue, and a possible return to vi - yikes 🙂
I am shocked the online Gnu Emacs wiki doesn’t mention this…they more or less tell you to live with it.
Sorry for the mistake in attribution
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
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!
I have added a suggested change to the Emacs wiki https://www.emacswiki.org/emacs/EmacsWikiSuggestions#h5o-1
@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!
Emacs is still great 🙂 !
> 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. 😉