From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Greg Rowe Newsgroups: gmane.emacs.help Subject: Re: Unusual C indentation conventions Date: Tue, 29 Mar 2005 07:57:19 -0500 Organization: Time-Warner Telecom Message-ID: <424950d1$0$3710$39cecf19@news.twtelecom.net> References: NNTP-Posting-Host: deer.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 1112101486 5842 80.91.229.6 (29 Mar 2005 13:04:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2005 13:04:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 29 15:04:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1DGGOf-0001dt-00 for ; Tue, 29 Mar 2005 15:04:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGGes-00031J-LU for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Mar 2005 08:21:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!newsread.com!news-xfer.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!news-xfer.cox.net!peer01.cox.net!cox.net!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 38 Original-NNTP-Posting-Date: 29 Mar 2005 12:57:53 GMT Original-NNTP-Posting-Host: 171c4c8d.news.twtelecom.net Original-X-Trace: DXC=OWSQ8A=D6EMcn?\5K_?h9OC_A=>8kQj6M=_1NR_H?JPM4R\^nMXgC8J<=dg>3m?k>GMF]NB8Ef^CH Original-X-Complaints-To: abuse@twtelecom.net Original-Xref: shelby.stanford.edu gnu.emacs.help:129705 Original-To: help-gnu-emacs@gnu.org 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:25259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25259 no spam wrote: > The code follows an indentation convention that is a bit > unusual for C. Opening and closing braces are on > a line by themselves and are indented at the same > level as the block they enclose: > if (someTest) > { > doSomething(); > doSomethingElse(); > } > Tab stops are set to 8. Each block of code is > indented by 4 from the previous block. (In the > vi editor set ts=8 set sw=4) The coding style whitesmith is close. C-c . to run c-set-style. Choose whitesmith. You can change the indenting amount in cc-mode by doing M-x set-variable and set c-basic-offset to the number of spaces you desire. You can change the tab stop width using the tab-width variable. M-x set-variable again. In your .emacs you might want something like the following to make everything happen automatically: (add-hook c-mode (lambda () (c-set-style "whitesmith") (setq c-basic-offset 4) (setq tab-width 8))) Good luck! Greg -- Home is where the .bashrc is.