octave-maintainers
[Top][All Lists]
Advanced

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

tab vs spaces


From: John W. Eaton
Subject: tab vs spaces
Date: Wed, 08 Oct 2008 14:46:24 -0400

The current contrib.txi file includes the following guideline:

  @node Octave Sources (m-files)
  @section Octave Sources (m-files)

  Don't use tabs.  Tabs cause trouble.  If you are used to them, set up
  your editor so that it converts tabs to spaces.  Indent the bodies
  of the statement blocks.  Recommended indent is 2 spaces.

  [...]

  @node C++ Sources
  @section C++ Sources

  Don't use tabs.  Tabs cause trouble.  If you are used to them, set up
  your editor so that it converts tabs to spaces.

Currently most Octave source files use a mixture of spaces and tabs
for indenting, and assumes that people will be looking at the sources
with something that aligns tabs on 8-space boundaries.  But if people
think that it would be better to always use spaces, that's fine with
me.

If we do agree that this is the way things should be done, should we
convert all the current sources so they conform to this guideline?
Doing that could cause some trouble for anyone who submits patches for
an old version, though that problem can be handled by

  taking a copy of the old version and converting tabs to spaces

  taking a copy of the old version and applying the patch, then
  converting tabs to spaces

  generating a new diff using these two new versions

Is it worth the trouble?

Should we add

  indent-tabs-mode: nil

to the Emacs Local Variables block in the Octave C++ sources so that
those of us using Emacs won't have to remember to deal with this when
editing the Octave sources, and so that new lines will be indented
with spaces instead of tabs, but old lines will be left alone?

Should we add

  %{
  ;;; Local Variables: ***
  ;;; mode: octave ***
  ;;; indent-tabs-mode: nil ***
  ;;; End: ***
  %}

to the bottom of all .m files in the distribution, similar to what we
have for the .cc and .h files?

jwe


reply via email to

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