Re: [HACKERS] Preliminary results for proposed new pgindentimplementation - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Preliminary results for proposed new pgindentimplementation
Date
Msg-id 20170616201042.GC5081@momjian.us
Whole thread Raw
In response to Re: [HACKERS] Preliminary results for proposed new pgindent implementation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 16, 2017 at 03:56:47PM -0400, Tom Lane wrote:
> can be.  I managed to tweak bsdindent so that its output matches
> what entab would do, by dint of the attached patch, which implements
> the rule "use a space instead of a tab if the tab would only move
> one column and we don't need another tab after it".  (I think entab
> is being weird with the second half of that rule, but if I remove it,
> I get circa a thousand lines of invisible whitespace changes; probably
> better not to deal with those.  With no patch at all, just letting
> bsdindent do what it does now, there's circa ten thousand changed lines.)

Yeah, entab was designed to do that, via this C comment:
/* * Is the next character going to be a tab?  We do tab * replacement in the current spot if the next char is * going
tobe a tab and ignore min_spaces. */
 


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

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



pgsql-hackers by date:

Previous
From: Sergey Burladyan
Date:
Subject: Re: [HACKERS] Broken hint bits (freeze)
Next
From: Piotr Stefaniak
Date:
Subject: Re: [HACKERS] Preliminary results for proposed new pgindentimplementation