From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Henrik Enberg Newsgroups: gmane.emacs.help Subject: Re: Novice question: my add-hook binding for c-mode doesnt work :( Date: Fri, 2 Dec 2005 08:07:01 +0100 (CET) Message-ID: <20051202070701.B40573F28@rocksteady.printf.se> References: <1732372.post@talk.nabble.com> <8764q8yorw.fsf@totoz.gnu-rox.org> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1133507666 11496 80.91.229.2 (2 Dec 2005 07:14:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2005 07:14:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 02 08:14:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ei57G-00022V-IV for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2005 08:13:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ei57F-0007ht-2u for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2005 02:13:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ei50d-0005QS-Ml for help-gnu-emacs@gnu.org; Fri, 02 Dec 2005 02:07:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ei50b-0005OZ-BD for Help-gnu-emacs@gnu.org; Fri, 02 Dec 2005 02:07:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ei50Z-0005No-St for Help-gnu-emacs@gnu.org; Fri, 02 Dec 2005 02:07:04 -0500 Original-Received: from [81.228.8.83] (helo=pne-smtpout1-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ei50Z-0002pP-KJ for Help-gnu-emacs@gnu.org; Fri, 02 Dec 2005 02:07:03 -0500 Original-Received: from rocksteady.printf.se (81.224.154.131) by pne-smtpout1-sn2.hy.skanova.net (7.2.060.1) id 438C7D00000D9EF6 for Help-gnu-emacs@gnu.org; Fri, 2 Dec 2005 08:07:01 +0100 Original-Received: by rocksteady.printf.se (Postfix, from userid 1000) id B40573F28; Fri, 2 Dec 2005 08:07:01 +0100 (CET) Original-To: Help-gnu-emacs@gnu.org In-reply-to: <8764q8yorw.fsf@totoz.gnu-rox.org> (message from Xavier Maillard on Fri, 02 Dec 2005 07:52:03 +0100) 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:31604 Archived-At: > From: Xavier Maillard > Date: Fri, 02 Dec 2005 07:52:03 +0100 > > "Kpoxman (sent by Nabble.com)" writes: > > > The code from .emacs: > > > > (add-hook 'c-mode-common-hook > > '(lambda () (define-key c-mode-map (kbd "M-o") 'kpox-switch-h-cpp)) > > ) > > This form is useless. You don't need to bind this key definition to this hook. > > Just use the (define-key ..) stuff and that *should* work. `c-mode-map' isn't defined until cc-mode is loaded, putting just the define-key in .emacs will thow an error. The problem is as someone pointed out that he should use `c-mode-base-map' instead of `c-mode-map'.