From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: File-specific cc-mode settings Date: Thu, 23 Aug 2007 10:24:48 +0200 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1187858444 1503 80.91.229.12 (23 Aug 2007 08:40:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2007 08:40:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 23 10:40:41 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 1IO8F6-0005vl-IY for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Aug 2007 10:40:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IO8F5-0008VS-Qw for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Aug 2007 04:40:39 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: gamma02.me.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1187857489 2125 129.16.50.72 (23 Aug 2007 08:24:49 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Thu, 23 Aug 2007 08:24:49 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:+cn4NeeWIy4yyDcq09BcU8ViHt0= Original-Xref: shelby.stanford.edu gnu.emacs.help:151199 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:46771 Archived-At: Alexander Kotelnikov writes: > I have cc-mode configuration which suits my needs, but for certain > files I'd like to get specific settings. So what I tried was putting > > /* > Local Variables: > mode:c > c-style-java: t > End: > */ (info "(ccmode)File Styles") -- Variable: c-file-style Set this variable to a style name string in the Local Variables list. From now on, when you visit the file, CC Mode will automatically set the file's style to this one using `c-set-style'. (The java style is used by default for *.java files, btw.) > But is does not help (I think, due to c-style-java is buffer local and > c-mode-hook is processed in another context, I see "not java" in > *Messages* buffer). The mode is set before processing file local variables, so `c-style-java' has the old value at this point. (CC mode uses hack-local-variables-hook to set the style from c-file-style.) -- Johan Bockgård