Re: updated emacs configuration - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: updated emacs configuration
Date
Msg-id 20140128213245.GT20898@momjian.us
Whole thread Raw
In response to Re: updated emacs configuration  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: updated emacs configuration
Re: updated emacs configuration
List pgsql-hackers
On Thu, Jun 27, 2013 at 09:54:45PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Should we be using entab -s 3?
> 
> IIUC, that wouldn't affect leading whitespace at all.  What it would
> affect I think (outside of comment blocks) is whitespace between code
> and a same-line /* ... */ comment.  Personally I'd prefer that a
> tab-stop-aligned /* ... */ comment always have a tab before it, even
> if the expansion of the tab is only *one* space.  That is, in
> 
>     foo(bar,    /* comment */
>         bar1,   /* comment */
>         bar12,  /* comment */
>         bar123, /* comment */
>         baz);   /* comment */
> 
> I think each of those comments ought to have a tab before it, not
> space(s).  pgindent currently does this inconsistently --- the bar123
> line will have a space instead.  Moving to -s 3 would presumably make
> this worse (even less consistent) not better, since now the bar12 line
> would also be emitted with spaces not a tab.
> 
> Inside a comment, though, probably the behavior of -s 3 would be just
> fine.  So the real problem here IMO is that use of tabs ought to be
> context sensitive (behavior inside a comment different from outside),
> and I don't think entab can do that.  I see though that it understands
> about C quoted strings, so maybe we could teach it about comments too?
> 
> No idea whether astyle is any smarter about this.

I see I already asked about entab -s 3.  Let me see how hard it would be
to modify entab.

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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()
Next
From: Andres Freund
Date:
Subject: Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()