From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Joachim Newsgroups: gmane.emacs.help Subject: Re: Emacs and C programming Date: Fri, 07 Dec 2007 18:50:09 +0100 Message-ID: <87wsrqcs32.fsf@gmx.de> References: <475980f3$0$36443$4fafbaef@reader5.news.tin.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197052910 27028 80.91.229.12 (7 Dec 2007 18:41:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2007 18:41:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 19:41:59 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0i8o-0001PK-B3 for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 19:41:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0i8W-0002KV-V4 for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2007 13:41:21 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uio.no!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: p548650ba.dip.t-dialin.net Original-X-Trace: quimby.gnus.org 1197049668 11006 84.134.80.186 (7 Dec 2007 17:47:48 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Fri, 7 Dec 2007 17:47:48 +0000 (UTC) User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:0eN7g1BPldDLkpX9gsjeJ4u8KCU= Original-Xref: shelby.stanford.edu gnu.emacs.help:154490 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49922 Archived-At: On 2007-12-07 18:20 +0100, Co$t@ntino wrote: > Hi, > I add this line in my .emacs file: > > (define-key c-mode-base-map "\C-m' newline-and-indent) > > To make RET (newline, C-m) equivalent to LFD (newline and indent, C-j). > > But when start Emacs says: "Symbol's value as variable is void: > c-mode-base-map". Surely, because c-mode has not been loaded yet. > How could I fix it? Use a hook to set the keybinding, e.g. (add-hook 'c-mode-common-hook (lambda () (define-key c-mode-base-map "\C-m" 'newline-and-indent))) does the trick for me. See also the Emacs manual, (Info "(emacs)Hooks"). Cheers, Sven