Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* usage of tab in the indentation...
@ 2002-09-12 12:06 Joel Brobecker
  2002-09-12 12:24 ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2002-09-12 12:06 UTC (permalink / raw)
  To: gdb-patches

I don't really know where to ask this question, but since this is
bugging me in the GDB sources, I'll ask here.

I looked at the GNU Coding Standards manual, and they give a list of
recommendations on how GNU code should be formatted, but they don't
mention tabulations.

In the list of options to GNU indent that they give, they leave the
choice of tabs or not to indent (ie they use the default, which is to
use tabs): (http://www.gnu.org/prep/standards_23.html#SEC23).

I personally find that tabs are a nuisance, what are the advantages of
using tabs? So far, they make my editor insert cursor go sometimes "like
crazy" but more importantly, they sometimes screw the diff output.
Consider the following hunk:

<<
--- 2071,2082 ----
    if (target_is_remote ())
      {
        if (args == 0 || *args == 0)
!       {
!         if (tracepoint_number == -1)
!           error ("No current tracepoint -- please supply an argument.");
!         else
!           tdp = tracepoint_number;    /* default is current TDP */
!       }
        else
        tdp = parse_and_eval_long (args);
  
>>

See how the left curly brace is misplaced because of the tab?

Could we consider banning tabs in favor of spaces and add -nut to
the list of indent options in gdb_indent.sh?

(I am not trying to start a troll, ok? :-).
-- 
Joel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 12:06 usage of tab in the indentation Joel Brobecker
@ 2002-09-12 12:24 ` Michael Snyder
  2002-09-12 12:45   ` Joel Brobecker
  2002-09-12 18:26   ` Tom Tromey
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Snyder @ 2002-09-12 12:24 UTC (permalink / raw)
  To: Joel Brobecker, gdb-patches

Joel Brobecker wrote:
> 
> I don't really know where to ask this question, but since this is
> bugging me in the GDB sources, I'll ask here.
> 
> I looked at the GNU Coding Standards manual, and they give a list of
> recommendations on how GNU code should be formatted, but they don't
> mention tabulations.
> 
> In the list of options to GNU indent that they give, they leave the
> choice of tabs or not to indent (ie they use the default, which is to
> use tabs): (http://www.gnu.org/prep/standards_23.html#SEC23).
> 
> I personally find that tabs are a nuisance, what are the advantages of
> using tabs? So far, they make my editor insert cursor go sometimes "like
> crazy" but more importantly, they sometimes screw the diff output.
> Consider the following hunk:
> 
> <<
> --- 2071,2082 ----
>     if (target_is_remote ())
>       {
>         if (args == 0 || *args == 0)
> !       {
> !         if (tracepoint_number == -1)
> !           error ("No current tracepoint -- please supply an argument.");
> !         else
> !           tdp = tracepoint_number;    /* default is current TDP */
> !       }
>         else
>         tdp = parse_and_eval_long (args);
> 
> >>
> 
> See how the left curly brace is misplaced because of the tab?
> 
> Could we consider banning tabs in favor of spaces and add -nut to
> the list of indent options in gdb_indent.sh?

For my part, I just use emacs' default formatting, which
pretty much relieves me of worrying about formatting, since
it almost always conforms to the coding standard.  And emacs
uses tabs.  It would be a nuisance for me to have to change.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 12:24 ` Michael Snyder
@ 2002-09-12 12:45   ` Joel Brobecker
  2002-09-12 14:13     ` Kevin Buettner
  2002-09-12 17:58     ` Michael Snyder
  2002-09-12 18:26   ` Tom Tromey
  1 sibling, 2 replies; 8+ messages in thread
From: Joel Brobecker @ 2002-09-12 12:45 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> For my part, I just use emacs' default formatting, which
> pretty much relieves me of worrying about formatting, since
> it almost always conforms to the coding standard.  And emacs
> uses tabs.  It would be a nuisance for me to have to change.

That's fair enough. I know it would cause some of us some problems
to switch to spaces, so wasn't really hoping for a change in policy,
but I'm still curious as to why we used tabs and not spaces. What are
the benefits?

In the meantime, I take it people will not yell if the indentation in a
patch looks a bit bizarre :-)...

-- 
Joel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 12:45   ` Joel Brobecker
@ 2002-09-12 14:13     ` Kevin Buettner
  2002-09-12 17:58     ` Michael Snyder
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2002-09-12 14:13 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Sep 12, 12:45pm, Joel Brobecker wrote:

> That's fair enough. I know it would cause some of us some problems
> to switch to spaces, so wasn't really hoping for a change in policy,
> but I'm still curious as to why we used tabs and not spaces. What are
> the benefits?

I'm not sure that there are any real benefits anymore, just inertia.  ;-)
At one time, I suspect that using tabs instead of spaces might've been
viewed as a space (as in storage) conserving measure.

One of the things which annoys me is that tabs mean different things
to different people.  I haven't found this to be an issue recently,
but there have been times when I've worked with code where the size of
the tab wasn't 8 and during those times, I wished we could all agree
to just do away with tabs.

> In the meantime, I take it people will not yell if the indentation in a
> patch looks a bit bizarre :-)...

I've gotten used to it.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 12:45   ` Joel Brobecker
  2002-09-12 14:13     ` Kevin Buettner
@ 2002-09-12 17:58     ` Michael Snyder
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2002-09-12 17:58 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:
> 
> > For my part, I just use emacs' default formatting, which
> > pretty much relieves me of worrying about formatting, since
> > it almost always conforms to the coding standard.  And emacs
> > uses tabs.  It would be a nuisance for me to have to change.
> 
> That's fair enough. I know it would cause some of us some problems
> to switch to spaces, so wasn't really hoping for a change in policy,
> but I'm still curious as to why we used tabs and not spaces. What are
> the benefits?

There's no rule that you have to use tabs either.
Feel free to use spaces.

> In the meantime, I take it people will not yell if the indentation in a
> patch looks a bit bizarre :-)...

We're used to it.  ;-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 12:24 ` Michael Snyder
  2002-09-12 12:45   ` Joel Brobecker
@ 2002-09-12 18:26   ` Tom Tromey
  2002-09-12 18:40     ` Andrew Cagney
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2002-09-12 18:26 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@redhat.com> writes:

Michael> And emacs uses tabs.  It would be a nuisance for me to have
Michael> to change.

Emacs, as always, is capable of anything:

(setq indent-tabs-mode nil)

Tom


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 18:26   ` Tom Tromey
@ 2002-09-12 18:40     ` Andrew Cagney
  2002-09-19  4:34       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-09-12 18:40 UTC (permalink / raw)
  To: tromey, Michael Snyder, Joel Brobecker; +Cc: gdb-patches

Before the thread goes awal.

Please don't start replacing tabs with spaces.  If people don't like the 
current emacs/indent behavour then they should persue this on the EMACS 
and indent mailing lists.

enjoy,
Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: usage of tab in the indentation...
  2002-09-12 18:40     ` Andrew Cagney
@ 2002-09-19  4:34       ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2002-09-19  4:34 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: tromey, Michael Snyder, Joel Brobecker, gdb-patches


On Thu, 12 Sep 2002, Andrew Cagney wrote:

> Please don't start replacing tabs with spaces.  If people don't like the 
> current emacs/indent behavour then they should persue this on the EMACS 
> and indent mailing lists.

Seconded.

In general, gratuitous changes in whitespace should be avoided 
altogether IMHO, as they make patches and "cvs diff"s hard to read.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-19 11:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12 12:06 usage of tab in the indentation Joel Brobecker
2002-09-12 12:24 ` Michael Snyder
2002-09-12 12:45   ` Joel Brobecker
2002-09-12 14:13     ` Kevin Buettner
2002-09-12 17:58     ` Michael Snyder
2002-09-12 18:26   ` Tom Tromey
2002-09-12 18:40     ` Andrew Cagney
2002-09-19  4:34       ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox