From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hongxu Chen Newsgroups: gmane.emacs.help Subject: Re: questions about the value of local variables Date: Tue, 14 May 2013 00:36:57 +0800 Message-ID: <8738tqdefq.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368463043 18023 80.91.229.3 (13 May 2013 16:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 May 2013 16:37:23 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alan Mackenzie Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 13 18:37:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UbvkY-0008WJ-3m for geh-help-gnu-emacs@m.gmane.org; Mon, 13 May 2013 18:37:22 +0200 Original-Received: from localhost ([::1]:45103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbvkX-00084P-Lj for geh-help-gnu-emacs@m.gmane.org; Mon, 13 May 2013 12:37:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbvkK-00080f-MG for help-gnu-emacs@gnu.org; Mon, 13 May 2013 12:37:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbvkI-0001Nt-20 for help-gnu-emacs@gnu.org; Mon, 13 May 2013 12:37:08 -0400 Original-Received: from mail-da0-x22c.google.com ([2607:f8b0:400e:c00::22c]:58819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbvkH-0001Nj-Rg for help-gnu-emacs@gnu.org; Mon, 13 May 2013 12:37:05 -0400 Original-Received: by mail-da0-f44.google.com with SMTP id z8so1170857daj.17 for ; Mon, 13 May 2013 09:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=iI01bmo8vBRp8oLcKrHAqWVbcl0DEojbTc2P7gw+/qg=; b=M43SU2xRLwD5XjIeBd8bYOEiT+I3zNOazGi3E3IOqLOZzUP1XKuphLcToDyKmzSyn6 y3npdPwwR4t3WM2X2j7lVHP6Sr1y1iElztzKcYlMbTfE9Jb9OCH86UlnljTtudazRsMX 76b3iz6q4FTCDRmUxtdaa+zrhr8EDXxrH+x/NVzqFIOeXNB+I0m9ULS+stWucd1bBjdj PnO1jwavn3Cvf8pM2r3aIuimjVX9cVh3gvgRwUhTZgb+FHmJyfIo/2Ct3DO4FJbiduGP fKWfipZE7tx32Tv99CeIdJu7F/qb/TZp2d6tU/10WFpg+jvKbfMTAnGFzx2g2YocOaOo qe7A== X-Received: by 10.66.145.161 with SMTP id sv1mr31249830pab.69.1368463024215; Mon, 13 May 2013 09:37:04 -0700 (PDT) Original-Received: from nonoobPC.STAP ([123.151.32.162]) by mx.google.com with ESMTPSA id xl10sm15611094pac.15.2013.05.13.09.37.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 09:37:03 -0700 (PDT) In-Reply-To: (Alan Mackenzie's message of "Sun, 12 May 2013 17:14:16 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c00::22c X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90699 Archived-At: Alan Mackenzie writes: > Hongxu Chen wrote: > >> Hi, > >> I am using Emacs for some C/C++ coding. > > [ .... ] > >> Still another question, is there any good practice to set the >> variables with proper hooks in c family programming language modes? >> There seems quite a lot of hooks there >> (`c-initialization-hook',`cc-mode-hook', `c-mode-hook', >> `c-mode-common-hook', etc) and I just get lost. >> > > Well, I don't think there's a `cc-mode-hook', but the others exist, > yes. :-) Sorry that I made a mistake. > > Basic rule: put (the bulk of) your CC Mode customisations on > `c-mode-common-hook'. If this doesn't work, you'll need one of the other > hooks. It's all documented on page "CC Hooks" in the CC Mode manual. Thanks for your advice. It seems that using the right hook really needs quite a lot of tricks. A few days ago I was adding a keymap for one of the command, but it didn't work until I use the `c-initialization-hook'. Well, seems that I have to read the docs first. > >> -- >> Regards, >> Hongxu Chen -- Regards, Hongxu Chen