Re: pgindent (Re: [HACKERS] LONG varsize - how to go on)t

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <wieck(at)debis(dot)com>, PostgreSQL HACKERS <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: pgindent (Re: [HACKERS] LONG varsize - how to go on)t
Date: 1999-12-20 02:29:35
Message-ID: 199912200229.VAA20208@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> On 1999-12-18, Bruce Momjian mentioned:
>
> > I remember clear mention that we did not like:
> >
> > if () {
> >
> > }
> >
> > I see you are writing your shell scripts with that, and am not a fan of
> > it, but it is only a shell script.
>
> What do I know about shell scripting? :)
>
> Seriously though, I didn't use to do that, but I get to like it more every
> day ... I was going to look for an example of uglily-formatted code now,
> but can't find one. My concern was more about the 4-space-tabs, because a
> tab is 8 spaces in the rest of the world. I have no problem with 4 space
> indentation and the good old bsd format.

As a workaround, there is a C program I wrote called entab in
pgsql/src/tools/entab. It has a manual page and everything. It does a
good job of converting tabs to any size, or removing all tabs. It does
certain fancy things like prevent tab changes inside quoted strings, and
clip trailing whitespace. That is what I do in my print filters.

I admit our current system is a pain. Our options are:

o go to 8 space tabs and 8 space indenting
o go to 8 space tabs and 4 space indenting
o keep 4 space tabs and 4 space indenting

The first option is out. Eight space indenting is a pain, and our code
would look terrible. Eight is just too much and prevents meaningful
indenting.

The second option is your preference. It is easier to print, but
editing the file can be a pain for editors that don't support
different tab/indent values. Also, I like cursoring over tabs, so
having some indents as 4 spaces and some as full tabs give the code a
funny feeling for me.

I print a lot less, and use entab do handle the 4-space issue, so it
seems the best for me.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-12-20 02:34:32 Re: [COMMITTERS] pgsql/src/interfaces/libpgeasy (libpgeasy.c)
Previous Message Hiroshi Inoue 1999-12-20 02:24:51 RE: [HACKERS] NOTICE: LockRelease: locktable lookup failed, no lock