From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Why isn't C-m listed here? Date: 16 Apr 2007 20:43:16 +0200 Message-ID: <20070416200316.GA2655@muc.de> References: <87d524l7mx.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176749014 1513 80.91.229.12 (16 Apr 2007 18:43:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2007 18:43:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eric Lilja Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 16 20:43:28 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdWAh-0001V6-Gu for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2007 20:43:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdWFK-00016w-Ly for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2007 14:48:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HdWFG-00015K-NW for emacs-devel@gnu.org; Mon, 16 Apr 2007 14:48:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HdWFF-00014e-Ax for emacs-devel@gnu.org; Mon, 16 Apr 2007 14:48:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdWFF-00014H-3Y for emacs-devel@gnu.org; Mon, 16 Apr 2007 14:48:09 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HdWAa-0006e3-U6 for emacs-devel@gnu.org; Mon, 16 Apr 2007 14:43:21 -0400 Original-Received: (qmail 64632 invoked by uid 3782); 16 Apr 2007 18:43:16 -0000 Original-Received: from acm.muc.de (p54A3DBE7.dip.t-dialin.net [84.163.219.231]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 16 Apr 2007 20:43:14 +0200 Original-Received: (qmail 2888 invoked by uid 1000); 16 Apr 2007 20:03:16 -0000 Original-Date: Mon, 16 Apr 2007 21:03:16 +0100 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69504 Archived-At: 'Evening, Eric! On Mon, Apr 16, 2007 at 04:43:17PM +0200, Eric Lilja wrote: > Miles Bader wrote: > >Eric Lilja [snip quoted raw email address] writes: > >>As the topic says: Why isn't C-m listed here: > >>and if it was, what would its description be? Alias for ? > >It's not an alias for RET, it _is_ RET. > >RET == C-m > Ok, thanks for the quick reply. So, C-m is RET which means newline. C-j > is newline-and-indent (C-m + ) so if I wanted a > newline-and-indent when I press in cc mode I could do: > (global-set-key "\C-m" "\C-j") > in my c mode common hook? Proper way to do it? You could do this, but better might be this: (defun my-c-initialization-hook () (define-key c-mode-base-map "\C-m" 'c-context-line-break)) (add-hook 'c-initialization-hook 'my-c-initialization-hook) , as suggested by the (current) CC Mode manual (page "Sample .emacs File"). This gives you proper continuation of comments and macros as well as indentation of ordinary statements. Note also that you don't need to use c-mode-common-hook here - it wouldn't do any harm, but you only need to bind the key once, not every time you open a fresh CC Mode buffer. > - Eric -- Alan Mackenzie (Ittersbach, Germany)