Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Return doesn't work any more

4 views
Skip to first unread message

Karl Voit

unread,
May 15, 2003, 6:41:37 PM5/15/03
to
Hi!

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)

Greg Hill

unread,
May 15, 2003, 9:21:14 PM5/15/03
to help-gn...@gnu.org
At 12:41 AM +0200 5/16/03, Karl Voit wrote:
>Hi!
>
>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?

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


Edward O'Connor

unread,
May 16, 2003, 8:01:11 PM5/16/03
to
> ;;; 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)

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

Karl Voit

unread,
May 17, 2003, 11:40:42 AM5/17/03
to
* Edward O'Connor <oco...@soe.ucsd.edu> wrote:
>
> 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.

Thank you! Didn't know that. Works great that way ;-)

0 new messages