Emacs Asked by aleks224 on September 2, 2021
To switch between tasks on an unaltered MacOS Mojave (OS X 10.14.6), one uses command-tab, which is convenient when done with the thumb finger. Now, in order to turn on the meta key inside Terminal (to allow e.g. skipping words with the cursor inside bash backward and forward emacs-style), I can tick the ‘use Option as Meta key’ in Terminal.app preferences.
This setup leaves me with option as meta key inside emacs, which is not ergonomic, as the key is physically too much on the left and my thumb finger needs to bend to get there.
I would like to:
Some things I tried:
mac-command-modifier
variable, as explained here, however my emacs 26.3, installed via brew install emacs
, doesn’t seem to know about this variable (ctrl-Can this be done? In other words, is there a way to have the command key be meta
in emacs and yet have command-tab still switch between tasks system-wide?
In non-windows mode, changes to ns-*
variables (such as ns-alternate-modifier
and ns-command-modifier
) are ignored. In particular, if the -nw
option is passed as argument to emacs, the logic that propagates changes to ns-*
variables (implemented in src/nsterm.c
) is not evaluated. See the call to init_display
in the src/emacs.c
in the Emacs 27.1 source code. Roughly, it'll evaluate stuff from nsterm.c
only if the window system is not inhibited (controlled by the inhibit_window_system
variable which is set if the -nw
flag is passed) and otherwise rely on src/term.c
. If the window system is inhibited, the ns-*
variables will still be visible - this is because syms_of_nsterm
is invoked regardless of the inhibit_window_system
variable at emacs.c:1930
. The variables are there but have no bearing on the actual key mappings.
As such when windows are inhibited, attempting to resolve this with ns-*
is a dead end. Iterm2 and its remapping features can be of help here until there's a better way:
..which simply remaps the left command key to left option key.
Also, in Preferences -> Profiles -> Keys, Left option key needs to be mapped to Esc+.
Answered by aleks224 on September 2, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP