help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing key binding for C-m with C-j for all CC Mode modes


From: Eric Lilja
Subject: Replacing key binding for C-m with C-j for all CC Mode modes
Date: 16 Apr 2007 11:49:13 -0700
User-agent: G2/1.0

Is this the proper way to do that?

(defun my-c-mode-common-hook ()
  ; my customizations for all of c-mode and related modes
  (message "Running my-c-mode-common-hook")
  ; Replace C-m (C-m == <RET> == newline) with C-j (newline-and-
indent).
  (define-key c-mode-base-map "\C-m" 'newline-and-indent)
  )
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

I tried with c-mode-map first but that didn't work out and display got
corrupted...

- Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]