Closed dmolesUC closed 2 years ago
Update: Whatever it is, it seems to be specific to the PC external keyboard (i.e., the MacBook's internal keyboard treats ns-right-alternate
as right and ns-alternate
as left.) Now if I only knew how to detect that…
I posted a related question on StackExchange and one of the commenters suggested disabling modifications. It looks like when I un-switch option and command in Keyboard Preferences, the problem goes away, which would also explain why it works on the internal keyboard.
I have a shared
init.el
that I use on several machines, all of which (till last week) were running High Sierra. It contains the following:The intent is to allow me to use left option as meta, and right option for accented characters etc.
However, since I reformatted one of the machines and installed Mojave, it doesn't seem to be working properly.
/Applications/Emacs.app/Contents/MacOS/Emacs -nw
, both option keys work as meta.(#2 is probably Terminal's fault, and I can't confirm at the moment whether it ever worked in High Sierra.)
As a further complication, I'm using a PC keyboard with option and command switched via Keyboard Preferences / Keyboard / Modifier Keys.
I confirmed with
eval-expression
that the relevant variables (what I think are the relevant variables) are set correctly --mac-right-option-modifier
isnil
, andmac-option-modifier
ismeta
.That said, I'm not sure where I found the
mac-
variables, and I see the variables on the Tips page are different. But they also seem correct --ns-alternate-modifier
ismeta
, andns-right-alternate-modifier
is nil.If I set
ns-right-alternate-modifier
tometa
, I get both keys acting as meta (i.e., I lose the modifier). If I then setns-alternate-modifier
tonone
, I get left alt as meta, right alt as modifier. So I can get the behavior I want, but only by setting the variables backwards; and I'm reluctant to do it in my sharedinit.el
as it may break the other machines.