* emacs ctrl-m is RET. how to change for rebinding ?
@ 2006-04-01 14:20 Stefan Horomnea
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Horomnea @ 2006-04-01 14:20 UTC (permalink / raw)
Hello,
I want to bind Ctrl-m to a function in .emacs, with:
(global-set-key [?\C-m] 'delete-backward-char)
But then, I discover that I bound "enter" to that function, cause Ctrl-m
is enter. How to solve this problem ? I want to insert newline with
enter and do delete-backward-char with Ctrl+m.
I googled for a very long time for this, but couldn't find the solution.
Thanks for your help
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: emacs ctrl-m is RET. how to change for rebinding ?
[not found] <mailman.267.1143901196.2481.help-gnu-emacs@gnu.org>
@ 2006-04-03 2:37 ` Stefan Monnier
2006-04-03 3:30 ` Johan Bockgård
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2006-04-03 2:37 UTC (permalink / raw)
> But then, I discover that I bound "enter" to that function, cause Ctrl-m
> is enter. How to solve this problem ? I want to insert newline with enter
> and do delete-backward-char with Ctrl+m.
When running in a tty, you don't get to choose: The `return' key sends a C-m
and that's all Emacs will ever see.
When running under X11, Emacs can indeed tell the difference. The `return'
key is mapped to C-m via function-key-map, so all you need to do is to bind
[return] explicitly to a command like `newline' and the mapping to C-m will
not happen:
(global-set-key [return] 'newline)
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: emacs ctrl-m is RET. how to change for rebinding ?
2006-04-03 2:37 ` Stefan Monnier
@ 2006-04-03 3:30 ` Johan Bockgård
0 siblings, 0 replies; 3+ messages in thread
From: Johan Bockgård @ 2006-04-03 3:30 UTC (permalink / raw)
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> all you need to do is to bind [return] explicitly to a command like
> `newline' and the mapping to C-m will not happen:
>
> (global-set-key [return] 'newline)
And now your minibuffer is broken.
--
Johan Bockgård
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-03 3:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-01 14:20 emacs ctrl-m is RET. how to change for rebinding ? Stefan Horomnea
[not found] <mailman.267.1143901196.2481.help-gnu-emacs@gnu.org>
2006-04-03 2:37 ` Stefan Monnier
2006-04-03 3:30 ` Johan Bockgård
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.