Re: updated emacs configuration - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: updated emacs configuration
Date
Msg-id 20140128212851.GS20898@momjian.us
Whole thread Raw
In response to Re: updated emacs configuration  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Jun 27, 2013 at 05:31:54PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Noah Misch wrote:
> >> Note that emacs and pgindent remain at odds over interior tabs in comments.
> >> When pgindent finds a double-space (typically after a sentence) ending at a
> >> tab stop, it replaces the double-space with a tab.  c-fill-paragraph will
> >> convert that tab to a *single* space, and that can be enough to change many
> >> line break positions.
> 
> > We should really stop pgindent from converting those double-spaces to
> > tabs.  Those tabs are later changed to three or four spaces when wording
> > of the comment is changed, and things start looking very odd.
> 
> +1.  That's probably the single most annoying bit of behavior in pgindent.
> Being a two-spaces-after-a-period kind of guy, it might bite me more
> often than other people, but now that somebody else has brought it up...

Sorry I am just getting to this.  I actually have an easy fix for this,
and it is a feature of entab:
$ entab -hUSAGE: entab [ -cdqst ] [file ...]        -c (clip trailing whitespace)        -d (delete tabs)        -q
(protectquotes)        -s minimum_spaces        -t tab_width
 

-s minimum_spaces defaults to 2, and pgindent doesn't change the
default. If we change the entab call in pgindent from
$entab -t4 -qc

to
$entab -t4 -qc -s3

we will no longer place a tab in this string, "friend.  Hopefully"
--

even if there is a tab stop before the 'H'.  It will use a 3-space
break.  Does that help?  Other ideas?  How about requiring 4?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: WIP patch (v2) for updatable security barrier views
Next
From: Alvaro Herrera
Date:
Subject: Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()