[gdal-dev] emacs configuration for correct code indentation?

Even Rouault even.rouault at mines-paris.org
Fri Sep 2 14:29:52 EDT 2011


Le vendredi 02 septembre 2011 02:42:10, Etienne Tourigny a écrit :
> Hi all,
> 
> Can someone point me to the correct emacs configuration (in .emacs file)
> that follows GDAL c++ coding standards? 
> 

Sorry, I don't use emacs...

> 
> It would be a nice addition to the Developer standards at
> http://trac.osgeo.org/gdal/wiki/rfc8_devguide .


> 
> The following seems to work, setting the spacing to 4, using spaces instead
> of tabs and also indenting "case" statements. Am I missing anything?
> 
> 
> (setq-default c-basic-offset 4
>           tab-width 4
>           indent-tabs-mode nil)
> (c-set-offset 'case-label '+)

Not sure if it is RFC material, but you can definitely share it in 
http://trac.osgeo.org/gdal/wiki/HowToContribute 

You have summed up perfectly the most important coding conventions.

You have also probably noticed the nice visual ascii art that is generally 
prepended before each function/method :

/************************************************************************/
/*                               foo()                                  */
/************************************************************************/

And if you really want to confuse FrankW and make him believe he has written 
the code himself, you'd write if( foo ) rather than if (foo) ;-)


> 
> Thanks,
> Etienne
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list