How do I get Emacs to recognize M-C (meta-shift-c) rather than translating it as m-c?
Currently when I do C-h k M-C
I get:
M-c (translated from M-C) runs the command capitalize-word.
How do I get it to NOT translate M-C to M-c?
To make all the letters in a word uppercase, position your cursor before the word and type M-u . To make all the words in a region uppercase, position your cursor before the region and set a mark. Then move your cursor below the region and type C-x C-u .
C-M-\ requires all three keys to be held at the same time, not like C-M \ . So, in your case, that's Ctrl-Alt-\ all together.
"RET" is the Return key while emacs runs in a terminal. and run emacs in terminal, your keybinding will have no effect. But the problem is, by binding (kbd "RET") , you are also binding (kbd "C-m") , regardless you run emacs in terminal or GUI.
Just use modifier S
(Shift) in your key binding. E.g.:
(global-set-key "\M-\S-c" 'foobar)
If there is nothing explicitly bound to the shifted key then Emacs automatically translates it to the unshifted key.
From the Elisp manual, node Key Sequence Input
:
If an input character is upper-case (or has the shift modifier) and has no key binding, but its lower-case equivalent has one, then
read-key-sequence' converts the character to lower case. Note that
lookup-key' does not perform case conversion in this way.
To get Emacs to distinguish the two is very easy: add a binding for M-C
. The translation from M-C
to M-c
happens as a fallback when no binding was found for M-C
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With