From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anand Dhanakshirur Newsgroups: gmane.emacs.help Subject: Re: How to customize the indentation of coding in C/C++ in emacs? Date: Tue, 02 Jun 2009 13:01:09 +0530 Organization: C-DOT Message-ID: <4A24D53D.5080508@cdotb.ernet.in> References: <4A24A209.6050307@cdotb.ernet.in> <20090602071431.GA6161@tomas> Reply-To: asd@cdotb.ernet.in NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030904030806010905060801" X-Trace: ger.gmane.org 1243927313 27996 80.91.229.12 (2 Jun 2009 07:21:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2009 07:21:53 +0000 (UTC) Cc: emacs help To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 02 09:21:49 2009 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 1MBOJg-0007sV-19 for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jun 2009 09:21:49 +0200 Original-Received: from localhost ([127.0.0.1]:50455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBOJf-0007bw-DA for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jun 2009 03:21:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBOJF-0007bj-P6 for help-gnu-emacs@gnu.org; Tue, 02 Jun 2009 03:21:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBOJB-0007Za-0l for help-gnu-emacs@gnu.org; Tue, 02 Jun 2009 03:21:21 -0400 Original-Received: from [199.232.76.173] (port=54768 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBOJA-0007ZX-Tw for help-gnu-emacs@gnu.org; Tue, 02 Jun 2009 03:21:16 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:8038) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MBOJA-0007v1-D2 for help-gnu-emacs@gnu.org; Tue, 02 Jun 2009 03:21:16 -0400 Original-Received: from ws9.cdotb.ernet.in ([202.41.72.121]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBOJ3-0004xV-D2 for help-gnu-emacs@gnu.org; Tue, 02 Jun 2009 03:21:12 -0400 Original-Received: from ws9.cdotb.ernet.in (localhost [127.0.0.1]) by localhost.cdotb.ernet.in (Postfix) with ESMTP id DDFFCA210; Tue, 2 Jun 2009 12:50:13 +0530 (IST) Original-Received: from universe.cdotb.ernet.in (universe.cdotb.ernet.in [192.168.42.10]) by ws9.cdotb.ernet.in (Postfix) with ESMTP id CD3919BB3; Tue, 2 Jun 2009 12:50:13 +0530 (IST) Original-Received: from surya.cdotb.ernet.in (surya.cdotb.ernet.in.cdotb.ernet.in [192.168.16.163]) by universe.cdotb.ernet.in (8.12.2+Sun/8.12.2) with ESMTP id n527KCn1022437; Tue, 2 Jun 2009 12:50:12 +0530 (IST) User-Agent: Thunderbird 2.0.0.19 (X11/20090105) In-Reply-To: <20090602071431.GA6161@tomas> X-TM-AS-Product-Ver: IMSS-7.0.0.7138-5.6.0.1016-16678.005 X-TM-AS-Result: No--13.869-5.0-31-1 X-imss-scan-details: No--13.869-5.0-31-1 X-Detected-Operating-System: by mx20.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:64896 Archived-At: This is a multi-part message in MIME format. --------------030904030806010905060801 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Thanks, I am sorry i was criptic. All my team members are indenting the files by the command > indent -bap -bl -ce -l80 bscSmSeAmMsgHlr.cpp > where, > -bap -> putting blank line after the defintion of procedure. > -bl -> formatting the braces > -ce -> cuddling up the else statement with the previous brace > -l80 -> for logically breaking the line after 80 columns(no need to=20 > scroll to right or enlarge the window) What i want is, when i press TAB key, It should indent according to the options given above, So that i don't=20 have to run the above command again on a file. How can i do it in emacs? Anand tomas@tuxteam.de wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, Jun 02, 2009 at 09:22:41AM +0530, Anand Dhanakshirur wrote: > > Funny, when the content of the mail is more terse than the vcard ;-) > > Answer: > Meta-x customize-variable > then > c-offsets-alist > > Customize to heart's content! > > You may browse your way to there (there are lots of interesting knobs > you might want to get acquainted to) by just typing > > Meta-x customize > then > > > and click your way along the links: > Programming -> Languages -> C -> C Syntactic Indentation > > (you might want, as an example, switch on "C Echo Syntactic > Information", which lets Emacs put the name of the syntactic construct > in the echo area, sso you can see how the key for this particular > indentation is called). > > Hope that helps > - -- tom=C3=A1s > =20 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > > iD8DBQFKJNFXBcgs9XrR2kYRAsNFAJoCpKqK7sjYonKIdWrUGkSgvn1QFQCdFb51 > HHRB7QuPlE+EK7l7vKJEb6w=3D > =3DUCKU > -----END PGP SIGNATURE----- > =20 --------------030904030806010905060801 Content-Type: text/x-vcard; charset=utf-8; name="asd.vcf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="asd.vcf" YmVnaW46dmNhcmQNCmZuOkFuYW5kIERoYW5ha3NoaXJ1cg0KbjpEaGFuYWtzaGlydXI7QW5h bmQNCmVtYWlsO2ludGVybmV0OmFzZEBjZG90Yi5lcm5ldC5pbg0KdGVsO3dvcms6KDA4MCkt MjUxMTkyOTUNCnRlbDtjZWxsOjk4ODYxNzg3NTANCngtbW96aWxsYS1odG1sOkZBTFNFDQp2 ZXJzaW9uOjIuMQ0KZW5kOnZjYXJkDQoNCg== --------------030904030806010905060801--