octave-maintainers
[Top][All Lists]
Advanced

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

Re: tab vs spaces


From: Jaroslav Hajek
Subject: Re: tab vs spaces
Date: Wed, 8 Oct 2008 21:32:03 +0200

On Wed, Oct 8, 2008 at 8:46 PM, John W. Eaton <address@hidden> wrote:
> 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.
>

I took the "no tabs" guideline from GNU coding standards. Sure we can omit it.

> 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?
>

I don't think so. I guess it's enough if we just recommend avoiding
tabs and let things change incrementally when people encounter them
and fix them. Fixing whitespaces is a style adjustment; and there are
others (e.g. formatting file lists in Makefiles).



> 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?
>

Personally, I don't really understand why these chunks are there. Not
only it's a little Emacs-centric (yes, I'm a ViMmer), but it also has
nothing to do with the contents. Isn't it possible to set up Emacs so
that it loads these settings automatically?

> jwe
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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