all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Question: meta key works in terminal but in emacs
@ 2020-04-11 23:47 Zhe Li
  2020-04-12  0:34 ` Perry Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Zhe Li @ 2020-04-11 23:47 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

I recently installed emacs-mac-port and spacemacs with brew casket. I want
to set the option key to meta. I did so on terminal preference and now the
option key works as meta on terminal. But the option key doesn't work in
emacs. When I type option+v it comes out as check marks. So the option key
in emacs is still option/alt key. My system is macOS 10.13. Any idea why
that is the case?

Best regards,
Zach


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question: meta key works in terminal but in emacs
  2020-04-11 23:47 Question: meta key works in terminal but in emacs Zhe Li
@ 2020-04-12  0:34 ` Perry Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Perry Smith @ 2020-04-12  0:34 UTC (permalink / raw)
  To: Zhe Li; +Cc: help-gnu-emacs


> On Apr 11, 2020, at 6:47 PM, Zhe Li <zacli@pdx.edu> wrote:
> 
> Hi there,
> 
> I recently installed emacs-mac-port and spacemacs with brew casket. I want
> to set the option key to meta. I did so on terminal preference and now the
> option key works as meta on terminal. But the option key doesn't work in
> emacs. When I type option+v it comes out as check marks. So the option key
> in emacs is still option/alt key. My system is macOS 10.13. Any idea why
> that is the case?

I don’t know those two ports.  I use EmacsForMacOS:
https://emacsformacosx.com <https://emacsformacosx.com/>

I use to build my own emacs.  As I recall, I tried the brew but didn’t like it but
that is just a vague memory.

I *think* everything that follows still applies but obviously I’m not sure.

You have three places to muck with things and you kinda have to mess
with them to find out what works best for you.

First is Apple => System Preferences => Keyboard.  Lower right is
“modifier keys”.  (But don’t change them yet! :-). Notice at the top is
a pull down for each keyboard that you have.  For me, I have my native
Mac laptop keyboard as well as a wireless non-Apple keyboard.

Second, as you mention, Terminal => Preferences => Keyboard is a
checkbox for “Use Option as Meta key”.

The magic that you might be missing is inside Emacs is a whole set
of variables such as ns-control-modifier which has an alias of 
mac-control-modifier.  There are others…

If you do M-x customize-group “ns” you will see the whole set of them.

Note that I am using emacs as a Mac windows client and not inside Terminal.
I much prefer the GUI mode even though I’m not really a GUI person.

One thing I would suggest is to use (in Terminal) `od -cx` … then type some
keys such as option+F and hit return and see what the keyboard is actually
sending.  The reason I mention the GUI mode is in that mode, emacs is
receiving key events and not a sequence of characters.  Some options,
like the options in Terminal, won’t have any effect on emacs in GUI mode.

My system is at 10.15 but I’m 99% sure all of the things above were in 10.13.

Good luck!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-12  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-11 23:47 Question: meta key works in terminal but in emacs Zhe Li
2020-04-12  0:34 ` Perry Smith

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.