Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This will be the preferred style for LibreOffice project?

Those settings are not by themselves enough to describe the traditional OOo, and thus also 
LibreOffice, coding style, but they do express (I believe; I am not a vim user) the ground rules: 
four column indentation "steps" or "offset", and no TABs in source files.

Using an appropriate number of spaces instead of actual TAB characters in the source files is very 
much preferred, and using spaces for indentation is actually enforced by our git hooks. And, 
if/when TAB characters still appear in source files, they should be interpreted as tabulating to 
the next multiple of four columns.

(Note: saying "TABs expand to four spaces" is over-simplifying and incorrect (although presumably 
people who say that don't actually mean it literally); the number of spaces (or other characters, 
for that matter) needed to reach the next multiple of four columns obviously depends on the column 
you are at. And obviously, all talk about "columns" assume a typewriter-style fixed-width typeface 
is used.)

Details concerning the preferred use of white space around parentheses in function calls etc, 
placement of braces, etc, can be learned by looking at existing source files.  For Emacs users, 
there is also elisp code available in the OOo wiki, I think it was, to set up an Emacs hook for 
proper handling of OOo/LO source files.

--tml



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.