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.
input-decode-map
does the trick. Quote from the emacs manual:
This keymap has the same structure as other keymaps, but is used differently: it specifies translations to make while reading key sequences, rather than bindings for key sequences.
It's the same principle like I've presented above, transforming Ctrl+m to something, say Ctrl+1
and map Ctrl+1 to your command. I use Ctrl+m for backward-kill-word
.
Here you go:
(global-set-key (read-kbd-macro "C-1") 'backward-kill-word)
(define-key input-decode-map "\C-m" [?\C-1])