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 n...@leadboat.com 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

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-style

Re: [HACKERS] updated emacs configuration

2014-06-10 Thread Tom Lane
Noah Misch n...@leadboat.com 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

Re: [HACKERS] updated emacs configuration

2014-06-09 Thread Tom Lane
Noah Misch n...@leadboat.com 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

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 n...@leadboat.com 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

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 style. I'd

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 - use defun instead

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-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 t...@sss.pgh.pa.us 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.

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 that

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com 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

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:04:54 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com 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

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com 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

Re: [HACKERS] updated emacs configuration

2014-02-06 Thread Andres Freund
On 2014-02-06 10:24:34 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com 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

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Robert Haas
On Thu, Jan 30, 2014 at 11:06 PM, Bruce Momjian br...@momjian.us 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-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

Re: [HACKERS] updated emacs configuration

2014-01-31 Thread Tom Lane
Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Robert Haas
On Wed, Jan 29, 2014 at 11:21 PM, Bruce Momjian br...@momjian.us wrote: On Wed, Jan 29, 2014 at 07:31:29PM -0500, Tom Lane wrote: Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Robert Haas
On Thu, Jan 30, 2014 at 3:04 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Robert Haas escribió: On Wed, Jan 29, 2014 at 11:21 PM, Bruce Momjian br...@momjian.us wrote: I compute 6627 lines as modified. What I did not do is handle _only_ cases with periods before the tabs. Should I

Re: [HACKERS] updated emacs configuration

2014-01-30 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com 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.

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-after-periods

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(q, a); /* ok: q

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 robertmh...@gmail.com 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

Re: [HACKERS] updated emacs configuration

2014-01-29 Thread Tom Lane
Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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

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 alvhe...@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

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 br...@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 /* ...

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 bit

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 to make

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Bruce Momjian br...@momjian.us 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

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Robert Haas
On Tue, Jan 28, 2014 at 11:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us 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

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 something like

Re: [HACKERS] updated emacs configuration

2014-01-28 Thread Tom Lane
Robert Haas robertmh...@gmail.com 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

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 emacs.samples,

Re: [HACKERS] updated emacs configuration

2013-08-07 Thread Dimitri Fontaine
Peter Eisentraut pete...@gmx.net 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

Re: [HACKERS] updated emacs configuration

2013-07-20 Thread Greg Stark
On Thu, Jun 27, 2013 at 10:31 PM, Tom Lane t...@sss.pgh.pa.us 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

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

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-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 tab.

Re: [HACKERS] updated emacs configuration

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

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 (such as

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Tom Lane
Andres Freund and...@2ndquadrant.com 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

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Alvaro Herrera
Tom Lane wrote: Andres Freund and...@2ndquadrant.com 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

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 alvhe...@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

Re: [HACKERS] updated emacs configuration

2013-06-27 Thread Tom Lane
Bruce Momjian br...@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 /*

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 br...@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 /* ...

Re: [HACKERS] updated emacs configuration

2013-06-26 Thread Dimitri Fontaine
Peter Eisentraut pete...@gmx.net 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

Re: [HACKERS] updated emacs configuration

2013-06-26 Thread Jan Urbański
On 26/06/13 10:51, Dimitri Fontaine wrote: Peter Eisentraut pete...@gmx.net 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

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 the

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-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 have a user

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: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 tool

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-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 .

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 Tom Lane
Andrew Dunstan and...@dunslane.net 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

Re: [HACKERS] updated emacs configuration

2013-06-21 Thread Dimitri Fontaine
Hi, Peter Eisentraut pete...@gmx.net 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

Re: [HACKERS] updated emacs configuration

2013-06-14 Thread Daniel Farina
On Thu, Jun 13, 2013 at 6:27 PM, Peter Eisentraut pete...@gmx.net 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

[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