Tabs or Spaces

Started by Simon Riggsabout 19 years ago10 messages
#1Simon Riggs
simon@2ndquadrant.com

Minor request for clarification:

I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

Trouble is, there are tabs throughout the code. What gives?

Should I be replacing tabs as spaces, or leaving them alone? At all?
Only in patches I submit? Everywhere?

I have no opinion either way as to what should be done. Please advise.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Simon Riggs (#1)
Re: Tabs or Spaces

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: Tabs or Spaces

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sure looks that way in the code. In fact it detabifies and then
retabifies, from what I can see.

cheers

andrew

#4Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#3)
Re: Tabs or Spaces

Andrew Dunstan wrote:

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sure looks that way in the code. In fact it detabifies and then
retabifies, from what I can see.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: Tabs or Spaces

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sorry, the mistake was in a reference to entab. It now reads:

entab converts spaces to tabs, used by pgindent

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#6Simon Riggs
simon@2ndquadrant.com
In reply to: Bruce Momjian (#5)
Re: Tabs or Spaces

On Thu, 2007-01-04 at 16:01 -0500, Bruce Momjian wrote:

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sorry, the mistake was in a reference to entab. It now reads:

entab converts spaces to tabs, used by pgindent

S'OK, just thought it was funny I'd been doing it backwards all this
time: Actively been replacing tabs with spaces. :-)

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

#7Alvaro Herrera
alvherre@commandprompt.com
In reply to: Simon Riggs (#6)
Re: Tabs or Spaces

Simon Riggs wrote:

On Thu, 2007-01-04 at 16:01 -0500, Bruce Momjian wrote:

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sorry, the mistake was in a reference to entab. It now reads:

entab converts spaces to tabs, used by pgindent

S'OK, just thought it was funny I'd been doing it backwards all this
time: Actively been replacing tabs with spaces. :-)

That explains why your patches always seemed to be so weird to me
spacing-wise :-)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#8Simon Riggs
simon@2ndquadrant.com
In reply to: Alvaro Herrera (#7)
Re: Tabs or Spaces

On Thu, 2007-01-04 at 21:41 -0300, Alvaro Herrera wrote:

Simon Riggs wrote:

S'OK, just thought it was funny I'd been doing it backwards all this
time: Actively been replacing tabs with spaces. :-)

That explains why your patches always seemed to be so weird to me

LOL

spacing-wise :-)

Nobody ever said... laughs/rolls eyes/sighs

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

#9Bruce Momjian
bruce@momjian.us
In reply to: Simon Riggs (#6)
Re: Tabs or Spaces

Simon Riggs wrote:

On Thu, 2007-01-04 at 16:01 -0500, Bruce Momjian wrote:

Tom Lane wrote:

"Simon Riggs" <simon@2ndquadrant.com> writes:

Minor request for clarification:
I read in the Developer's FAQ that tabs should be interpreted as 4
spaces. ...and also that pgindent replaces tabs as spaces.

No, it does the opposite (or I would hope so anyway).

Sorry, the mistake was in a reference to entab. It now reads:

entab converts spaces to tabs, used by pgindent

S'OK, just thought it was funny I'd been doing it backwards all this
time: Actively been replacing tabs with spaces. :-)

It was a little more complex because entab does conversion to/from tabs,
but pgindent uses it in the "to tabs" mode.

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#10Jim Nasby
decibel@decibel.org
In reply to: Simon Riggs (#8)
Re: Tabs or Spaces

On Jan 4, 2007, at 7:54 PM, Simon Riggs wrote:

On Thu, 2007-01-04 at 21:41 -0300, Alvaro Herrera wrote:

Simon Riggs wrote:

S'OK, just thought it was funny I'd been doing it backwards all this
time: Actively been replacing tabs with spaces. :-)

That explains why your patches always seemed to be so weird to me

LOL

spacing-wise :-)

Nobody ever said... laughs/rolls eyes/sighs

I just figured you were using British tabs instead of American ones. ;P
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)