From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: Unusual C indentation conventions Date: Tue, 29 Mar 2005 15:48:21 GMT Organization: x Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112111382 9009 80.91.229.2 (29 Mar 2005 15:49:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2005 15:49:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 29 17:49:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DGIxI-0007LO-Up for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Mar 2005 17:48:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGJDc-0004Ig-Q7 for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Mar 2005 11:05:28 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.ems.psu.edu!news.cse.psu.edu!elk.ncren.net!news2.wam.umd.edu!nntp.abs.net!newsread.com!news-xfer.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!prodigy.net!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!404941e6!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:XDg7ZB/NcBWgrPx23rHS1nkuqoM= Original-Lines: 46 Original-NNTP-Posting-Host: 65.67.63.60 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr12.news.prodigy.com 1112111301 ST000 65.67.63.60 (Tue, 29 Mar 2005 10:48:21 EST) Original-NNTP-Posting-Date: Tue, 29 Mar 2005 10:48:21 EST X-UserInfo1: S[OSS\WGPZYKRT\YN[OJNW@@YJ_ZTB\MV@BD]\YIJYWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[ZOE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM Original-Xref: shelby.stanford.edu gnu.emacs.help:129714 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:25268 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25268 >>>> no spam writes: > 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) Try this.. you'll probably want to modify the tabs. (setq indent-tabs-mode nil tab-always-indent nil tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60) tab-width 4) (defun my-c-mode-common-hook () (turn-on-font-lock) (setq c-tab-always-indent nil) (c-set-offset 'substatement-open 0) (c-set-offset 'arglist-intro 1) (c-set-offset 'defun-open 4) (c-set-offset 'defun-block-intro 0) (c-set-offset 'statement 0) (c-set-offset 'substatement-open 4) (c-set-offset 'statement-block-intro 0) (c-set-offset 'substatement 4) (c-set-offset 'statement-cont 4) (c-set-offset 'label -4) (c-set-offset 'topmost-intro-cont 4) (c-set-offset 'brace-list-intro 0) (c-set-offset 'class-open 4) (c-set-offset 'class-close 4) (c-set-offset 'topmost-intro '-) (c-set-offset 'brace-list-open 4) (c-set-offset 'access-label '--) (c-set-offset 'func-decl-cont 0) (c-set-offset 'case-label 0) (c-set-offset 'statement-case-intro 4) (c-set-offset 'statement-case-open 4) (c-set-offset 'inline-open '+)) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)