Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


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

emacs and C++ { } indenting



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 25 Feb 2004 11:36:14 -0500 (EST)
David Kramer <david at thekramers.net> wrote:

> Emacs C++ mode seems to insist on K&R style indenting of brackets like
> 
> void Foo:Bar(Baz myBaz) {
> 	// code here
> }
> 
> 
> I prefer the ANSI style like
> 
> void Foo:Bar(Baz myBaz) 
> {
>         // code here
> }
> 
I think this has been answered. While the first set of braces are K&R
style as they are used in the K&R books. The other two common styles:
void Foo:Bar(Baz myBaz) 
{
        // code here
}
and 
void Foo:Bar(Baz myBaz) 
    {
        // code here
    }
Are just personal/professional styles. 


BTW: K&R function style is:
void Foo:Bar(Baz myBaz) 
{
        // code here
}

But K&R if and while statement form is:
	if (condition) {
        	// code
	}


- -- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAPPP3+wA+1cUGHqkRAhEvAJ9HJi0ANIKBdrgmWCp3Qgo0tFeXJQCdHG66
C4u1at5yd5hoyK677JkTYZk=
=u4pf
-----END PGP SIGNATURE-----




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org