help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to customize the indentation of coding in C/C++ in emacs?


From: Anand Dhanakshirur
Subject: Re: How to customize the indentation of coding in C/C++ in emacs?
Date: Tue, 02 Jun 2009 13:01:09 +0530
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

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 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 have to run the above command again on a file.
How can i do it in emacs?
Anand

address@hidden 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 <ENTER>
  then
    c-offsets-alist <ENTER>

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 <ENTER>
  then
    <ENTER>

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ás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKJNFXBcgs9XrR2kYRAsNFAJoCpKqK7sjYonKIdWrUGkSgvn1QFQCdFb51
HHRB7QuPlE+EK7l7vKJEb6w=
=UCKU
-----END PGP SIGNATURE-----

Attachment: asd.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]