From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "ishikawa,chiaki" Newsgroups: gmane.emacs.help Subject: Re: C++-mode indentation and how to apply it to all the files under a directory. Date: Fri, 07 Aug 2009 00:49:03 +0900 Message-ID: <4A7AFB6F.7040103@yk.rim.or.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249573798 579 80.91.229.12 (6 Aug 2009 15:49:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Aug 2009 15:49:58 +0000 (UTC) To: dima@sphinx.net.ru, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 06 17:49:51 2009 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 1MZ5Dy-0007nx-9i for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Aug 2009 17:49:50 +0200 Original-Received: from localhost ([127.0.0.1]:35616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZ5Dx-0002Gw-RF for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Aug 2009 11:49:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZ5DY-0002Fm-AZ for help-gnu-emacs@gnu.org; Thu, 06 Aug 2009 11:49:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZ5DT-0002Ez-0X for help-gnu-emacs@gnu.org; Thu, 06 Aug 2009 11:49:23 -0400 Original-Received: from [199.232.76.173] (port=34329 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZ5DS-0002Ew-QK for help-gnu-emacs@gnu.org; Thu, 06 Aug 2009 11:49:18 -0400 Original-Received: from mbos141-211.alpenstock.jp ([220.156.141.211]:42039 helo=phnompenh.mbos.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZ5DS-00011J-2C for help-gnu-emacs@gnu.org; Thu, 06 Aug 2009 11:49:18 -0400 Original-Received: from [172.16.30.43] ([172.16.30.43]) by phnompenh.mbos.jp ([172.16.30.51]) with ESMTP id 2009080700:49:05:504258.10069.2608843664 for ; Fri, 07 Aug 2009 00:49:05 +0900 (JST) Original-Received: (qmail 13302 invoked from network); 7 Aug 2009 00:49:05 +0900 Original-Received: from nttkyo944079.tkyo.nt.ftth.ppp.infoweb.ne.jp (HELO [192.168.0.112]) (ishikawa_yk@smp.mbos.jp@[115.177.130.79]) (envelope-sender ) by soul.mbos (qmail-ldap-1.03) with SMTP for ; 7 Aug 2009 00:49:05 +0900 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) Original-References: 878whx8ga6.fsf@sphinx.net.ru X-TERRACE-SPAMMARK: NOT spam-marked. (by Terrace) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:66855 Archived-At: Dmirty Dzhus wrote: >> Q-1: How to place "{" at the same indention level as "if" and "for" when >> "{" is placed on the next line using C++mode. > > Set your C style to "bsd". You'll still need to adjust offset to 2 > (because it's 8 by default for bsd). It did the trick. It seems that the mode setting in per-file variables sets the offset to 2. So I am done! (I have not done much editing yet, and so if something comes up again, I may post again , but now I know more about the various settings and can probably handle the rest.) >> Q-2: The second question is how to apply the setting to all c++ files >> under a certain directory, but not elsewhere. > > (info "(emacs) Directory Variables") This is a new feature in 23.1, isn't it? I installed emacs 23.1 and all is well now (!). It has been years since I read Emacs manual from cover to cover. Maybe I should again. The per-directory variable section in Info manual is section 57 and so the whole manual has more sections these days. Maybe my summer holidays are not long enough to read it through... > -- > Happy Hacking. > Thank you and happy hacking!