all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* rebind key in a single major mode
@ 2003-01-23  0:52 Glen Coates
  2003-01-23 10:21 ` Kai Großjohann
  0 siblings, 1 reply; 3+ messages in thread
From: Glen Coates @ 2003-01-23  0:52 UTC (permalink / raw)


Hi,

I've currently got the enter key bound to C-j in all modes because it
makes indenting so much easier, however, in gdb-mode this means I have to
hit C-m instead of enter because gdb-mode doesn't recognise C-j as the
newline character (I think).

What do I need to put in my .emacs in order to rebind enter to C-m for
gdb-mode only?

--
Cheers,
Glen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rebind key in a single major mode
  2003-01-23  0:52 rebind key in a single major mode Glen Coates
@ 2003-01-23 10:21 ` Kai Großjohann
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Großjohann @ 2003-01-23 10:21 UTC (permalink / raw)


"Glen Coates" <spam.really.sucks.balls.glen.coates@csiro.au.parse.that.spambot> writes:

> I've currently got the enter key bound to C-j in all modes because it
> makes indenting so much easier, however, in gdb-mode this means I have to
> hit C-m instead of enter because gdb-mode doesn't recognise C-j as the
> newline character (I think).
>
> What do I need to put in my .emacs in order to rebind enter to C-m for
> gdb-mode only?

Can you show us exactly what you did?  I get confused reading your
description.

Anyhow, (define-key gud-mode-map (kbd "RET") 'something-or-other)
might do the trick.

Hm.

Ah, maybe you did this: (global-set-key (kbd "<return>") (kbd "C-j")).
In that case, I suggest to do (global-set-key (kbd "RET")
'newline-and-indent), instead.  Then RET and C-m and <return> will
behave the same in most modes, except where there is a special binding.
-- 
Ambibibentists unite!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* rebind key in a single major mode
@ 2003-01-23 14:21 Dr. F.C.Caner
  0 siblings, 0 replies; 3+ messages in thread
From: Dr. F.C.Caner @ 2003-01-23 14:21 UTC (permalink / raw)


.... or, you can just do

(add-hook 'gud-mode-hook '(lambda() (local-set-key (kbd "<return>") (kbd "RET"))))

FCC

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-23 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-23  0:52 rebind key in a single major mode Glen Coates
2003-01-23 10:21 ` Kai Großjohann
  -- strict thread matches above, loose matches on Subject: below --
2003-01-23 14:21 Dr. F.C.Caner

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.