Why is Ctrl+M bound to Enter in Ubuntu Jaunty? How to turn it off?
I\'m using Emacs and would like to bind Ctrl+M to some other command.
I think your question is backwards. It is not C-m that is bound to Enter, it is Enter that is bound to C-m. And C-m is the same as RET
.
If you run C-h k C-m, you will see something like "RET runs the command ...
". C-m sends RET
because it is a control code, see http://en.wikipedia.org/wiki/Control_character.
The Enter key is bound to C-m; if you run C-h k Enter, you will see something like "RET (translated from
". See, Enter is being interpreted by emacs as
What you want to do is first remove the translation from RET
by binding it directly to what it's currently indirectly bound, e.g. (global-set-key (kbd "
. Then you're free to bind C-m to whatever you want without affecting Enter.
This assumes you're using the graphical emacs. If you're running it in a terminal, this won't work, because Enter will send C-m, not window-system
variable though.