From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Local Variables question: c-file-style and c-doc-comment-style Date: Wed, 17 Jan 2007 23:21:09 -0700 Message-ID: References: <45AC8932.6080400@math.uni-koeln.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169101327 19103 80.91.229.12 (18 Jan 2007 06:22:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 06:22:07 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 07:22:03 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 1H7Qep-0000w3-UR for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 07:21:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7Qeq-0005zC-D5 for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 01:21:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7QeQ-0005xT-AP for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 01:21:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7QeO-0005x0-0n for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 01:21:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7QeN-0005wx-PF for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 01:21:27 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H7QeM-0003Ek-T6 for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 01:21:27 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H7QeC-0006Og-7v for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 07:21:16 +0100 Original-Received: from c-24-9-156-178.hsd1.co.comcast.net ([24.9.156.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jan 2007 07:21:16 +0100 Original-Received: from kevin.d.rodgers by c-24-9-156-178.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jan 2007 07:21:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 86 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-9-156-178.hsd1.co.comcast.net User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) In-Reply-To: <45AC8932.6080400@math.uni-koeln.de> 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:40411 Archived-At: Daniel Rubin wrote: > (I'm new here, so first of all: Best greetings to everyone!) Welcome! > I have a problem concerning local variables in files (set by a > "Local Variables:" block at the end of a file). > > Here's what I'm trying to achieve: > > In C++ files, I'd like to set the indentation style (stroustrup), > apply some customizations (indentation inside namespace blocks), > and turn on a specific documentation comment style (javadoc). I > currently do it like this: > >> // Local Variables: >> // c-file-style:"stroustrup" >> // c-file-offsets:((innamespace . 0)) >> // c-doc-comment-style:javadoc >> // End: > > > Setting the indentation style and changing the indentation inside > namespaces works fine, but the doc-comment style is NOT set. > > Looking at variable c-doc-comment-style, it tells me that it's > local within that buffer and having a setting different from the > global default: > >> c-doc-comment-style's value is ((java-mode . javadoc) >> (pike-mode . autodoc)) >> >> Local in buffer EadesLinSmythProgression.hpp; global value is >> ((c++-mode . javadoc) >> (java-mode . javadoc) >> (pike-mode . autodoc)) > > > The documentation on c-file-style says that having a non-zero > value for this variable automatically makes all style variables > local, so I guess that's the problem. > > How do I manage to set the doc-comment style? > > Defining an own style (in my personal Emacs config) including that > setting is not an option, as other people (with other config > files) should be able to work with these files without nuking the > indentation. > > emacs-version: 21.4.1 > mode: c++-mode (CC Mode version 5.30.9) (Semantic version 2.0pre3) > OS: Linux (Fedora Core 4) I don't know if any of this applies to Emacs 21.4, but the CC Mode manual distributed with Emacs 22.0.92 says the following: ,---- | The default value for `c-doc-comment-style' is | `((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc))'. | | Note that CC Mode uses this variable to set other variables that | handle fontification etc. That's done at mode initialization or | when you switch to a style which sets this variable. Thus, if you | change it in some other way, e.g. interactively in a CC Mode | buffer, you will need to do `M-x java-mode' (or whatever mode | you're currently using) to reinitialize. | | Note also that when CC Mode starts up, the other variables are | modified before the mode hooks are run. If you change this | variable in a mode hook, you'll have to call | `c-setup-doc-comment-style' afterwards to redo that work. `---- These are just guesses, but you could try forcing a call to c-setup-doc-comment-style in the Local Variables block (after you set c-doc-comment-style): eval: (c-setup-doc-comment-style) or via the mode hook (in your ~/.emacs): (add-hook 'c++-mode-hook 'c-setup-doc-comment-style) -- Kevin Rodgers Denver, Colorado, USA