From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "jodocus" Newsgroups: gmane.emacs.help Subject: c indentation problem Date: Mon, 28 Aug 2006 11:28:53 +0200 Organization: @Home Benelux Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1156758030 4792 80.91.229.2 (28 Aug 2006 09:40:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2006 09:40:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 28 11:40:27 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GHdbX-0007zw-3k for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Aug 2006 11:40:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHdbW-0003JF-Mq for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Aug 2006 05:40:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!multikabel.net!feed20.multikabel.net!newshub2.home.nl!newshub1.home.nl!home.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: cc637674-a.groni1.gr.home.nl Original-X-Trace: news1.zwoll1.ov.home.nl 1156757319 25823 82.73.3.203 (28 Aug 2006 09:28:39 GMT) Original-X-Complaints-To: usenet@corp.home.nl Original-NNTP-Posting-Date: Mon, 28 Aug 2006 09:28:39 +0000 (UTC) X-Newsreader: NewsMan Pro 2.5 (Freeware) Original-Xref: shelby.stanford.edu gnu.emacs.help:141363 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:36983 Archived-At: Hi, I have the following problem: for a project I am working on, the C code at the start of a function is indented as follows: void func ( arglist a ) { int somevar; char someothervar; do_something(); if( cond ) { action; } } As you can see, the declaration of variables at the start of the function body is not indented. Then, there is an empty line, and the rest of the function (the "real" body containing statements that are not variable declarations) is indented. How do I get emacs to understand this? I already have the following code in my .emacs, which works pretty well, except for the above problem. (defconst my-c-style '((c-basic-offset . 4) (c-comment-only-line-offset . 0) (c-offsets-alist (statement-block-intro . +) ; (knr-argdecl-intro . 0) ; (knr-argdecl . 0) ; (topmost-intro . 0) ; (topmost-intro-cont . 0) (substatement-open . 0) (label . 0) (case-label . +) (statement-cont . +) (inline-open . 0) (inexpr-class . 0)) ) "MY style")