According to the Emacs' manual, modifier keys are case-insensitive due to "historical reasons".
Can I change this behaviour?
My goal is making M-a
and M-A
to mean different things.
Thanks!
According to the manual,
A Control-modified alphabetical character is always considered case-insensitive: Emacs always treats C-A as C-a, C-B as C-b, and so forth. The reason for this is historical.
So you couldn't define them like:
(global-set-key (kbd "C-a") 'xxx)
(global-set-key (kbd "C-A") 'yyy)
but S-
can be used for Shift, so:
(global-set-key (kbd "C-a") 'xxx)
(global-set-key (kbd "C-S-a") 'yyy) ;; C-A
is OK. And
For all other modifiers, you can make the modified alphabetical characters case-sensitive when you customize Emacs. For instance, you could make M-a and M-A run different commands.
So you can define key-binding like this:
(global-set-key (kbd "M-a") 'xxx)
(global-set-key (kbd "M-A") 'yyy)
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