Difference between revisions of "Cpp Coding Standards/FORMAT/NoTabs"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== No Tabs ==
+
== No Tabs (NoTabs) ==
  
 
Various editors have different ways to turn on the "use spaces not tabs" setting. See [[:Category:Developer_Tools]] for advice on configuring your favorite editor to use spaces instead of tabs.
 
Various editors have different ways to turn on the "use spaces not tabs" setting. See [[:Category:Developer_Tools]] for advice on configuring your favorite editor to use spaces instead of tabs.
  
 
=== in-line markup ===
 
=== in-line markup ===
 +
Not source-relevant data in source code should be avoided as much as possible. So inline markup to tell various editors how to handle this file should only be used, if really necessary. One reason could be that you work in different projects with different needs with the same editor.
  
I reckon it's best to set the appropriate directives in the files you own, along the line of e.g. sw/source/filter/ww8/ww8par.cxx
+
'''If''' it is unavoidable, set the appropriate directives in the files you own, along the line of e.g. sw/source/filter/ww8/ww8par.cxx, where the last line is  
 
+
where the last line is  
+
 
+
 
     /* vi:set tabstop=4 shiftwidth=4 expandtab: */
 
     /* vi:set tabstop=4 shiftwidth=4 expandtab: */
  
 
I'm not sure if the corresponding  
 
I'm not sure if the corresponding  
 
 
     /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
 
     /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
 +
near the top is sufficient to "do the right thing" for emacs ?
  
near the top is sufficient to "do the right thing" for emacs ?
+
----
 +
[[Category:Coding Standards]]

Latest revision as of 08:40, 23 May 2007

No Tabs (NoTabs)

Various editors have different ways to turn on the "use spaces not tabs" setting. See Category:Developer_Tools for advice on configuring your favorite editor to use spaces instead of tabs.

in-line markup

Not source-relevant data in source code should be avoided as much as possible. So inline markup to tell various editors how to handle this file should only be used, if really necessary. One reason could be that you work in different projects with different needs with the same editor.

If it is unavoidable, set the appropriate directives in the files you own, along the line of e.g. sw/source/filter/ww8/ww8par.cxx, where the last line is

   /* vi:set tabstop=4 shiftwidth=4 expandtab: */

I'm not sure if the corresponding

   /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */

near the top is sufficient to "do the right thing" for emacs ?


Personal tools