Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-09 Thread Andrew Dunstan
On 06/05/2018 05:33 PM, Andrew Gierth wrote: "Matthew" == Matthew Woodcraft writes: Matthew> A few days ago there was a suggestion on this list to add a Matthew> .editorconfig file specifying tab width: Matthew>

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Andrew Gierth
> "Matthew" == Matthew Woodcraft writes: Matthew> A few days ago there was a suggestion on this list to add a Matthew> .editorconfig file specifying tab width: Matthew> https://www.postgresql.org/message-id/87efhuz9be.fsf%40news-spur.riddles.org.uk Matthew> The .editorconfig format

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Andrew Gierth
> "Peter" == Peter Eisentraut writes: >> + (lambda () (add-to-list 'write-file-functions >> 'delete-trailing-whitespace) Peter> dir-locals doesn't work this way. It's not a general lisp file. Right. The correct approach is + (eval add-hook

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Matthew Woodcraft
On 2018-06-05 18:22, David Fetter wrote: > Folks, > > Here's my attempt to $subject. I've tested with vim, but I'm much less > certain I got the EMACS code right. > > Is there any interest in such a feature? A few days ago there was a suggestion on this list to add a .editorconfig file

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Peter Eisentraut
On 6/5/18 13:37, Tom Lane wrote: > I note that Peter E. seems to have a recipe for finding such issues, > which I suspect is grounded in some obscure git feature or other. > That might be easier to work with, since you'd only need one fix > not one per editor. I have a git alias:

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Peter Eisentraut
On 6/5/18 13:22, David Fetter wrote: > diff --git a/.dir-locals.el b/.dir-locals.el > index 9525d6b604..858461e6bd 100644 > --- a/.dir-locals.el > +++ b/.dir-locals.el > @@ -4,7 +4,8 @@ > (c-file-style . "bsd") > (fill-column . 78) > (indent-tabs-mode . t) >

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Teodor Sigaev
I use FileStly plugin to vim [1]. But I slightly modify it,  see in attachment. FileStyle, sorry. -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Teodor Sigaev
I once tried to have vim highlight trailing whitespace, spaces before tabs, and overlength lines (>80 chars), and while I could do each thing in isolation, I wasn't able to get it to highlight the three of them at the same time. If you have a recipe for that, I welcome it. I use FileStly

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread David Fetter
On Tue, Jun 05, 2018 at 01:28:54PM -0400, Alvaro Herrera wrote: > On 2018-Jun-05, David Fetter wrote: > Hi David > > > Here's my attempt to $subject. I've tested with vim, but I'm much less > > certain I got the EMACS code right. > > > > Is there any interest in such a feature? > > I'd rather

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Jun-05, David Fetter wrote: >> Is there any interest in such a feature? > I'd rather have the editor warn me (highlight) such things rather than > fix them silently (I wonder if it'd cause a mess with regression .out > files for example, which I do edit on

Re: [PATCH] Trim trailing whitespace in vim and emacs

2018-06-05 Thread Alvaro Herrera
On 2018-Jun-05, David Fetter wrote: Hi David > Here's my attempt to $subject. I've tested with vim, but I'm much less > certain I got the EMACS code right. > > Is there any interest in such a feature? I'd rather have the editor warn me (highlight) such things rather than fix them silently (I