Re: [HACKERS] updated emacs configuration

2014-06-12 Thread Noah Misch
On Tue, Jun 10, 2014 at 10:36:07AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Mon, Jun 09, 2014 at 09:04:02PM -0400, Peter Eisentraut wrote: > >> I'd consider just getting rid of the > >> > >> (c-file-style . "bsd") > >> > >> setting in .dir-locals.el and put the actual interesting setti

Re: [HACKERS] updated emacs configuration

2014-06-10 Thread Tom Lane
Noah Misch writes: > On Mon, Jun 09, 2014 at 09:04:02PM -0400, Peter Eisentraut wrote: >> On Sun, 2014-06-08 at 21:55 -0400, Noah Misch wrote: >>> After upgrading to GNU Emacs 23.4.1 from a version predating directory-local >>> variables, I saw switch/case indentation go on the fritz. My hooks we

Re: [HACKERS] updated emacs configuration

2014-06-10 Thread Noah Misch
On Mon, Jun 09, 2014 at 09:04:02PM -0400, Peter Eisentraut wrote: > On Sun, 2014-06-08 at 21:55 -0400, Noah Misch wrote: > > After upgrading to GNU Emacs 23.4.1 from a version predating directory-local > > variables, I saw switch/case indentation go on the fritz. My hooks were > > issuing (c-set-s

Re: [HACKERS] updated emacs configuration

2014-06-09 Thread Peter Eisentraut
On Sun, 2014-06-08 at 21:55 -0400, Noah Misch wrote: > After upgrading to GNU Emacs 23.4.1 from a version predating directory-local > variables, I saw switch/case indentation go on the fritz. My hooks were > issuing (c-set-style "postgresql"), but ".dir-locals.el" set it back to plain > "bsd" styl

Re: [HACKERS] updated emacs configuration

2014-06-09 Thread Noah Misch
On Mon, Jun 09, 2014 at 10:52:34AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Wed, Aug 07, 2013 at 07:57:53AM -0400, Peter Eisentraut wrote: > >> Did anyone have any outstanding concerns about this latest version? I > >> thought it looked ready to commit. > > > After upgrading to GNU Ema

Re: [HACKERS] updated emacs configuration

2014-06-09 Thread Tom Lane
Noah Misch writes: > On Wed, Aug 07, 2013 at 07:57:53AM -0400, Peter Eisentraut wrote: >> Did anyone have any outstanding concerns about this latest version? I >> thought it looked ready to commit. > After upgrading to GNU Emacs 23.4.1 from a version predating directory-local > variables, I saw

Re: [HACKERS] updated emacs configuration

2014-06-08 Thread Noah Misch
On Wed, Aug 07, 2013 at 07:57:53AM -0400, Peter Eisentraut wrote: > On 7/2/13 8:42 PM, Peter Eisentraut wrote: > > Updated files with changes: > > > > - adjusted fill-column to 78, per Noah > > - added c-file-style, per Andrew > > - support both "postgresql" and "postgres" directory names > > - us

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:24:34 -0500, Tom Lane wrote: > Andres Freund writes: > > Nah, not for that ;). I mean I haven't seen any replacement for pgindent > > that generates equivalent variable indentations. > > Seems odd. I thought netbsd's indent was pretty much the granddaddy of > them all --- so you

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund writes: > Nah, not for that ;). I mean I haven't seen any replacement for pgindent > that generates equivalent variable indentations. Seems odd. I thought netbsd's indent was pretty much the granddaddy of them all --- so you'd expect newer tools to be able to replicate that style.

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:04:54 -0500, Tom Lane wrote: > Andres Freund writes: > > What I haven't seen in any tool yet is something to resemble our > > indentation style for variable declarations. Do we feel that's a > > dealbreaker for any tool? > > Well, we're unlikely to change pgindent's rules to conf

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund writes: > What I haven't seen in any tool yet is something to resemble our > indentation style for variable declarations. Do we feel that's a > dealbreaker for any tool? Well, we're unlikely to change pgindent's rules to conform to the behavior of some random emacs mode, if that's w

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Alvaro Herrera
Andres Freund wrote: > What I haven't seen in any tool yet is something to resemble our > indentation style for variable declarations. Do we feel that's a > dealbreaker for any tool? I find our style more aesthetically pleasing than any other I've seen; but anyway the changes if we used a tool th

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2013-07-21 02:06:02 +0100, Greg Stark wrote: > On Thu, Jun 27, 2013 at 10:31 PM, Tom Lane wrote: > > > > AFAIR, no one has ever done a serious comparison to anything except GNU > > indent, and (at least at the time) it seemed to have bugs as bad as > > pgindent's, just different ones. I'm cert

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Peter Eisentraut
On 7/20/13, 9:06 PM, Greg Stark wrote: > In theory this tool is promising though since it works by looking at > the llvm bytecode to determine what the real syntax is. It should be > able to handle the typedef issues we have with most of the the tools. Since clang-format has no options to specify

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Bruce Momjian
On Fri, Jan 31, 2014 at 11:57:28AM -0500, Tom Lane wrote: > Bruce Momjian writes: > > OK. I have updated entab.c to support this new ability as -m. When > > should it be run this against HEAD and supported back branches? Probably > > when we run pgindent for 9.4. > > Yeah. The whole point is t

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Tom Lane
Bruce Momjian writes: > OK. I have updated entab.c to support this new ability as -m. When > should it be run this against HEAD and supported back branches? Probably > when we run pgindent for 9.4. Yeah. The whole point is to keep the branches in sync for patching, so we need to do them all at

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Bruce Momjian
On Fri, Jan 31, 2014 at 08:58:21AM -0500, Robert Haas wrote: > > OK, eight hours later, I have the results for only removing tabs after > > periods in comments: > > > > http://momjian.us/expire/entab_comment.v2.cdiff > > http://momjian.us/expire/entab_comment.v2.pdiff > > ht

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Robert Haas
On Thu, Jan 30, 2014 at 11:06 PM, Bruce Momjian wrote: > On Thu, Jan 30, 2014 at 03:36:48PM -0500, Bruce Momjian wrote: >> On Thu, Jan 30, 2014 at 03:32:27PM -0500, Robert Haas wrote: >> > Or this: >> > >> > - mp_int_copy(a, b); /* ok: 0 <= r < b */ >> > - mp_int_copy(&q, a); /* ok: q <= a */ >>

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Bruce Momjian
On Thu, Jan 30, 2014 at 03:36:48PM -0500, Bruce Momjian wrote: > On Thu, Jan 30, 2014 at 03:32:27PM -0500, Robert Haas wrote: > > Or this: > > > > - mp_int_copy(a, b); /* ok: 0 <= r < b */ > > - mp_int_copy(&q, a); /* ok: q <= a */ > > + mp_int_copy(a, b); /* ok: 0 <= r < b */ > > + mp_int_copy

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Bruce Momjian
On Thu, Jan 30, 2014 at 03:32:27PM -0500, Robert Haas wrote: > Or this: > > - mp_int_copy(a, b); /* ok: 0 <= r < b */ > - mp_int_copy(&q, a); /* ok: q <= a */ > + mp_int_copy(a, b); /* ok: 0 <= r < b */ > + mp_int_copy(&q, a); /* ok: q <= a */ > > I do agree with you some of the changes-a

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Tom Lane
Alvaro Herrera writes: > Robert Haas escribió: >> I don't have any comment on that specific point, but I took a quick >> look through one of these diffs and it looks like a lot of churn for >> no improvement. So I'm not sure what we want to do here, but I don't >> think it's this. > I, on the co

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Robert Haas
On Thu, Jan 30, 2014 at 3:04 PM, Alvaro Herrera wrote: > Robert Haas escribió: >> On Wed, Jan 29, 2014 at 11:21 PM, Bruce Momjian wrote: >> > I compute 6627 lines as modified. What I did not do is handle _only_ >> > cases with periods before the tabs. Should I try that? >> >> I don't have any c

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Alvaro Herrera
Robert Haas escribió: > On Wed, Jan 29, 2014 at 11:21 PM, Bruce Momjian wrote: > > I compute 6627 lines as modified. What I did not do is handle _only_ > > cases with periods before the tabs. Should I try that? > > I don't have any comment on that specific point, but I took a quick > look thro

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Robert Haas
On Wed, Jan 29, 2014 at 11:21 PM, Bruce Momjian wrote: > On Wed, Jan 29, 2014 at 07:31:29PM -0500, Tom Lane wrote: >> Bruce Momjian writes: >> > I have cleaned up entab.c so I am ready to add a new option that removes >> > tabs from only comments. Would you like me to create that and provide a >

Re: [HACKERS] updated emacs configuration

2014-01-29 Thread Bruce Momjian
On Wed, Jan 29, 2014 at 07:31:29PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > I have cleaned up entab.c so I am ready to add a new option that removes > > tabs from only comments. Would you like me to create that and provide a > > diff at a URL? It would have to be run against all back b

Re: [HACKERS] updated emacs configuration

2014-01-29 Thread Tom Lane
Bruce Momjian writes: > I have cleaned up entab.c so I am ready to add a new option that removes > tabs from only comments. Would you like me to create that and provide a > diff at a URL? It would have to be run against all back branches. If you think you can actually tell the difference reliab

Re: [HACKERS] updated emacs configuration

2014-01-29 Thread Bruce Momjian
On Wed, Jan 29, 2014 at 12:53:02AM -0500, Tom Lane wrote: > Robert Haas writes: > > If this only affects a handful of places, then sure, let's go ahead > > and fix it. But if it's going to create a massive enough diff that > > we've gotta think about back-patching it, then IMHO it's totally not >

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Robert Haas writes: > If this only affects a handful of places, then sure, let's go ahead > and fix it. But if it's going to create a massive enough diff that > we've gotta think about back-patching it, then IMHO it's totally not > worth it. A quick grep search says there are well over 3000 comm

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Andres Freund
On 2014-01-28 18:39:43 -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > > > I see I already asked about entab -s 3. Let me see how hard it would be > > to modify entab. > > I cannot tell you what to waste your time on, of course, but I wonder if > it'd be better spent trying to make somet

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Robert Haas
On Tue, Jan 28, 2014 at 11:03 PM, Tom Lane wrote: > Bruce Momjian writes: >> On Tue, Jan 28, 2014 at 10:40:10PM -0500, Tom Lane wrote: >>> TBH I'm not sure we should be changing pgindent at this late date, even if >>> there is a good fix for its minor annoyances. When you changed its wrap >>> be

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Bruce Momjian writes: > On Tue, Jan 28, 2014 at 10:40:10PM -0500, Tom Lane wrote: >> TBH I'm not sure we should be changing pgindent at this late date, even if >> there is a good fix for its minor annoyances. When you changed its wrap >> behavior in 8.1, I spent the next several years cursing tha

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Bruce Momjian
On Tue, Jan 28, 2014 at 10:40:10PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > I see I already asked about entab -s 3. Let me see how hard it would be > > to modify entab. > > TBH I'm not sure we should be changing pgindent at this late date, even if > there is a good fix for its minor an

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Bruce Momjian writes: > I see I already asked about entab -s 3. Let me see how hard it would be > to modify entab. TBH I'm not sure we should be changing pgindent at this late date, even if there is a good fix for its minor annoyances. When you changed its wrap behavior in 8.1, I spent the next

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Bruce Momjian
On Tue, Jan 28, 2014 at 06:39:43PM -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > > > I see I already asked about entab -s 3. Let me see how hard it would be > > to modify entab. > > I cannot tell you what to waste your time on, of course, but I wonder if > it'd be better spent trying t

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Alvaro Herrera
Bruce Momjian wrote: > > I see I already asked about entab -s 3. Let me see how hard it would be > to modify entab. I cannot tell you what to waste your time on, of course, but I wonder if it'd be better spent trying to make something like astyle work for us. The entab/pg_bsd_indent combo is a b

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Bruce Momjian
On Thu, Jun 27, 2013 at 09:54:45PM -0400, Tom Lane wrote: > Bruce Momjian 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

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Bruce Momjian
On Thu, Jun 27, 2013 at 05:31:54PM -0400, Tom Lane wrote: > Alvaro Herrera 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

Re: [HACKERS] updated emacs configuration

2013-08-07 Thread Dimitri Fontaine
Peter Eisentraut writes: > Did anyone have any outstanding concerns about this latest version? I > thought it looked ready to commit. I wanted to have another round at trying it here and get a better understanding at my failures of the previous time, but that's not a blocker at all. I had anothe

Re: [HACKERS] updated emacs configuration

2013-08-07 Thread Peter Eisentraut
On 7/2/13 8:42 PM, Peter Eisentraut wrote: > Updated files with changes: > > - adjusted fill-column to 78, per Noah > - added c-file-style, per Andrew > - support both "postgresql" and "postgres" directory names > - use defun instead of lambda, per Dimitri > - put Perl configuration back into emac

Re: [HACKERS] updated emacs configuration

2013-07-20 Thread Greg Stark
On Thu, Jun 27, 2013 at 10:31 PM, Tom Lane wrote: > > AFAIR, no one has ever done a serious comparison to anything except GNU > indent, and (at least at the time) it seemed to have bugs as bad as > pgindent's, just different ones. I'm certainly open to another choice > as long as we don't lose on

Re: [HACKERS] updated emacs configuration

2013-07-02 Thread Peter Eisentraut
Updated files with changes: - adjusted fill-column to 78, per Noah - added c-file-style, per Andrew - support both "postgresql" and "postgres" directory names - use defun instead of lambda, per Dimitri - put Perl configuration back into emacs.samples, for Tom I also added configuration of c-auto-

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Bruce Momjian
On Thu, Jun 27, 2013 at 09:54:45PM -0400, Tom Lane wrote: > Bruce Momjian 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

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Tom Lane
Bruce Momjian 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 alw

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Bruce Momjian
On Thu, Jun 27, 2013 at 05:31:54PM -0400, Tom Lane wrote: > Alvaro Herrera 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

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Alvaro Herrera
Tom Lane wrote: > Andres Freund writes: > > > Being at least one of the persons having mentioned astyle to Alvaro, I > > had tested that once and I thought the results were resembling something > > reasonable after an hour of fiddling or so. But there were certain > > things that I could not be m

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Tom Lane
Andres Freund writes: > I think before doing any serious testing we would need to lay out how > many changes and what changes in formatting we would allow and what kind > of enforced formatting rules we think are required. Well, we certainly never applied any such analysis to pgindent. I persona

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Andres Freund
On 2013-06-27 17:31:54 -0400, Tom Lane wrote: > > Really, we should get out of patched BSD indent entirely already. How > > about astyle, for instance? I'm told that with some sensible options, > > the diff to what we have now is not very large, and several things > > actually become sensible (su

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Tom Lane
Alvaro Herrera 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

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Bruce Momjian
On Thu, Jun 27, 2013 at 03:51:15PM -0400, Alvaro Herrera wrote: > 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 ta

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Alvaro Herrera
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

Re: [HACKERS] updated emacs configuration

2013-06-26 Thread Noah Misch
On Tue, Jun 25, 2013 at 11:17:47PM -0400, Peter Eisentraut wrote: > On Sun, 2013-06-23 at 16:03 -0400, Noah Misch wrote: > > > ((c-mode . ((c-basic-offset . 4) > > > (fill-column . 79) > > > > I don't know whether you'd consider it to fall within the scope of this > > update, but 78 is

Re: [HACKERS] updated emacs configuration

2013-06-26 Thread Jan Urbański
On 26/06/13 10:51, Dimitri Fontaine wrote: Peter Eisentraut writes: $ git clone git://git.postgresql.org/git/postgresql.git Cloning into 'postgresql'... I can reproduce that here. I don't know why I have those postgres dirs then, and I'm pretty confused about my round of testing now. Maybe

Re: [HACKERS] updated emacs configuration

2013-06-26 Thread Dimitri Fontaine
Peter Eisentraut writes: >> emacs -q src/backend/commands/extension.c >> emacs -q -l ../emacs.samples src/backend/commands/extension.c > > Well, the first one uses 8-space tabs, the second 4-space tabs, so they > look completely different. I'm not sure what you are trying to point > out.

Re: [HACKERS] updated emacs configuration

2013-06-25 Thread Peter Eisentraut
On Sun, 2013-06-23 at 16:37 -0400, Tom Lane wrote: > I'm un-thrilled with this as well, though for a slightly different > reason: we have a policy that the PG sources should be tool agnostic, > and in fact removed file-local emacs settings awhile back because of > that. We don't want to keep the t

Re: [HACKERS] updated emacs configuration

2013-06-25 Thread Peter Eisentraut
On Sun, 2013-06-23 at 16:03 -0400, Noah Misch wrote: > > ((c-mode . ((c-basic-offset . 4) > > (fill-column . 79) > > I don't know whether you'd consider it to fall within the scope of this > update, but 78 is the fill-column setting that matches pgindent. Well, well, well. I did some

Re: [HACKERS] updated emacs configuration

2013-06-25 Thread Peter Eisentraut
On Sun, 2013-06-23 at 16:11 -0400, Andrew Dunstan wrote: > > The idea is a very good one in principle, but my short experiment with > > the provided .dir-locals.el didn't give me BSD style brace > > indentation. It works if we can do those "unsafe" things, but then we > > surely don't want to ha

Re: [HACKERS] updated emacs configuration

2013-06-25 Thread Peter Eisentraut
On Fri, 2013-06-21 at 11:20 +0200, Dimitri Fontaine wrote: > I've tested that on a new git clone and with the `emacs -q` command so > as not to load any of my local setup. While the indentation seemed ok, > the placement of the comments seems way off: > > Compare what you see using those commands:

Re: [HACKERS] updated emacs configuration

2013-06-23 Thread Tom Lane
Andrew Dunstan writes: > The idea is a very good one in principle, but my short experiment with > the provided .dir-locals.el didn't give me BSD style brace indentation. > It works if we can do those "unsafe" things, but then we surely don't > want to have a user prompted to accept the settings

Re: [HACKERS] updated emacs configuration

2013-06-23 Thread Andrew Dunstan
On 06/23/2013 03:43 PM, Andrew Dunstan wrote: The idea is a very good one in principle, but my short experiment with the provided .dir-locals.el didn't give me BSD style brace indentation. It works if we can do those "unsafe" things, but then we surely don't want to have a user prompted to

Re: [HACKERS] updated emacs configuration

2013-06-23 Thread Noah Misch
On Thu, Jun 13, 2013 at 09:27:07PM -0400, Peter Eisentraut wrote: > I think the suggested emacs configuration snippets in > src/tools/editors/emacs.samples no longer represent current best > practices. I have come up with some newer things that I'd like to > propose for review. > ((c-mode . ((c-b

Re: [HACKERS] updated emacs configuration

2013-06-23 Thread Andrew Dunstan
On 06/13/2013 09:27 PM, Peter Eisentraut wrote: I think the suggested emacs configuration snippets in src/tools/editors/emacs.samples no longer represent current best practices. I have come up with some newer things that I'd like to propose for review. First, I propose adding a .dir-locals.el

Re: [HACKERS] updated emacs configuration

2013-06-21 Thread Dimitri Fontaine
Hi, Peter Eisentraut writes: > I think the suggested emacs configuration snippets in > src/tools/editors/emacs.samples no longer represent current best > practices. I have come up with some newer things that I'd like to > propose for review. Thanks for doing that! > First, I propose adding a .

Re: [HACKERS] updated emacs configuration

2013-06-14 Thread Daniel Farina
On Thu, Jun 13, 2013 at 6:27 PM, Peter Eisentraut wrote: > First, I propose adding a .dir-locals.el file to the top-level directory > with basic emacs settings. These get applied automatically. This > especially covers the particular tab and indentation settings that > PostgreSQL uses. With thi

[HACKERS] updated emacs configuration

2013-06-13 Thread Peter Eisentraut
I think the suggested emacs configuration snippets in src/tools/editors/emacs.samples no longer represent current best practices. I have come up with some newer things that I'd like to propose for review. First, I propose adding a .dir-locals.el file to the top-level directory with basic emacs se