From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "chris.danx" Newsgroups: gmane.emacs.help Subject: Re: C formatting Date: Sat, 28 Dec 2002 01:11:05 +0000 Organization: ntl News Service Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <6Q6P9.169$fA3.25203@newsfep1-gui.server.ntli.net> References: <3E0CED7C.7020002@free.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1041037935 18740 80.91.224.249 (28 Dec 2002 01:12:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 28 Dec 2002 01:12:15 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18S5WQ-0004s7-00 for ; Sat, 28 Dec 2002 02:12:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18S5Uq-0001pn-02 for gnu-help-gnu-emacs@m.gmane.org; Fri, 27 Dec 2002 20:10:36 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!demon!peernews!peer.cwci.net!newspeer1-gui.server.ntli.net!ntli.net!newsfep1-gui.server.ntli.net.POSTED!53ab2750!not-for-mail User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en, en-us Original-Newsgroups: gnu.emacs.help In-Reply-To: <3E0CED7C.7020002@free.fr> X-Inktomi-Trace: pc2-bbrg1-4-cust73.renf.cable.ntl.com 1041037697 14785 80.4.70.73 (28 Dec 2002 01:08:17 GMT) Original-Lines: 35 Original-NNTP-Posting-Host: 80.1.224.5 Original-X-Complaints-To: abuse@ntlworld.com Original-X-Trace: newsfep1-gui.server.ntli.net 1041037698 80.1.224.5 (Sat, 28 Dec 2002 01:08:18 GMT) Original-NNTP-Posting-Date: Sat, 28 Dec 2002 01:08:18 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:108524 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5053 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5053 Oodini wrote: > hello, > > I am fighting with EMacs in order to get my programmation style: Did that a while back too, but thankfully someone gave me some code that gives a nice looking indentation style. > void function(int x, int y) > { > blabla; > if (...) > { > blabla > blabla > } > else > blabla; > } This works ok for me and produces indentation like above (add-hook 'c-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4)))) and this works for Java mode (just in case you need it later) (add-hook 'java-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4)))) Danx -- for personal replies change spamoff to chris