From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: david@adboyd.com (J. David Boyd) Newsgroups: gmane.emacs.help Subject: Re: C-mode-style whitesmith with emacs 21/22 Date: Fri, 15 Feb 2008 11:21:07 -0500 Message-ID: <87ejbekx70.fsf@adboyd.com> References: <47b52516$0$24080$9b622d9e@news.freenet.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203092528 23336 80.91.229.12 (15 Feb 2008 16:22:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2008 16:22:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 15 17:22:32 2008 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 1JQ3KV-0003qh-Iq for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Feb 2008 17:22:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQ3K1-00062t-Bu for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Feb 2008 11:21:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQ3Jj-00061t-Bk for help-gnu-emacs@gnu.org; Fri, 15 Feb 2008 11:21:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQ3Jh-00061h-M2 for help-gnu-emacs@gnu.org; Fri, 15 Feb 2008 11:21:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQ3Jh-00061e-Gf for help-gnu-emacs@gnu.org; Fri, 15 Feb 2008 11:21:37 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JQ3Jh-0001Js-31 for help-gnu-emacs@gnu.org; Fri, 15 Feb 2008 11:21:37 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JQ3Ja-0001hM-Ni for help-gnu-emacs@gnu.org; Fri, 15 Feb 2008 16:21:32 +0000 Original-Received: from 72.186.72.129 ([72.186.72.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Feb 2008 16:21:30 +0000 Original-Received: from david by 72.186.72.129 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Feb 2008 16:21:30 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 72.186.72.129 User-Agent: Gnus/5.1100000000000003 (Gnus v5.11) Emacs/22.1 (cygwin) Cancel-Lock: sha1:Rg2XtDQhvSEKyRKbgBHBTe24dPc= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:51563 Archived-At: Lars Meier writes: > Hallo NG, > > I'm using whitesmith style for the emacs c-mode because this style is > very simular to the existing code I'm working on. > > Some time ago I switched to emacs 22 because the version has some > improvements which are important for me. But with emacs 22 the > whitesmith-style does the indentation different than emacs 21 at least > in the default setting. Hear is a short example: > > emacs 21: > > int main() > { > my_function(xxxxxxxxxxxx, > yyyyyyyyyyyy, > zzzzzzzzzz); > } > > > emacs 22: > > int main() > { > my_function(xxxxxxxxxxxx, > yyyyyyyyyyyy, > zzzzzzzzzz); > } > > > But the emacs-22-version is not what I need and it's very tedious to fix > this by hand. Is there a simple way to change this back to the old > behaviour maybe by changing an indentation setting or something like that? > > > Lars I do something like this, (defun my-c-mode-common-hook () (c-set-style "user") (c-set-offset 'case-label '+) (c-set-offset 'substatement-open 0) (setq fill-column 75) (imenu-add-menubar-index) (add-hook 'c-mode-hook 'turn-on-cwarn-mode) ) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) You would need to change "user" to "whitesmith", and tweak a little, but it should not be all that hard to do. Dave