When I add the lines
;;; Ctrl-M for _m_y personal shortcuts (as a test)
(global-unset-key "\C-m")
(global-set-key "\C-ml" 'goto-line)
(global-set-key "\C-mg" 'goto-line)
(global-set-key "\C-mf" 'flyspell-mode)
to my .emacs, there's only 'RET' in the line at the bottom instead of
a simple return in the buffer currently edited.
Why does this affect the return-key and how do I get my custom
shortcuts without harming my enter-key?
TNX
--
Karl VOIT, Graz University of Technology (Austria/Europe)
That's because in the ASCII character set \C-m (a.k.a. "control M")
is the code for "carriage return." Depending on your platform, you
_may_ be able to get your Emacs session to distinguish between typing
the RETURN key and typing the M key while holding down the control
key. But don't count on it. You can save yourself a lot of time and
grief by just getting used to the idea that \C-m and RET are the same
thing, and never trying to use \C-m as anything else. (By the way,
\C-i is the ASCII code for TAB, so you may as well resign yourself to
that as well.)
--Greg
FYI, sequences of the form C-c <letter> are reserved for the user (you),
so it doesn't make much sense to use C-m here.
--
Edward O'Connor
oco...@soe.ucsd.edu
Thank you! Didn't know that. Works great that way ;-)