Re: [PATCHv5][PING^4] Vimrc config with GNU formatting

2014-12-08 Thread Jeff Law
On 11/28/14 10:26, Yury Gribov wrote: commit 3f560e9dd16a5e914b6f2ba82edffe13dfde944c Author: Yury Gribov Date: Thu Oct 2 15:50:52 2014 +0400 2014-10-02 Laurynas Biveinis Yury Gribov Vim config with GNU formatting. contrib/ * vimrc: New file. /

[PATCHv5][PING^4] Vimrc config with GNU formatting

2014-11-28 Thread Yury Gribov
On 11/06/2014 01:31 PM, Yury Gribov wrote: On 10/21/2014 07:24 PM, Yury Gribov wrote: On 10/13/2014 02:26 PM, Yury Gribov wrote: On 10/02/2014 09:14 PM, Yury Gribov wrote: On 09/17/2014 09:08 PM, Yury Gribov wrote: > On 09/16/2014 08:38 PM, Yury Gribov wrote: >> Hi all, >> >> This is the t

[PATCHv5][PING^3] Vimrc config with GNU formatting

2014-11-06 Thread Yury Gribov
On 10/21/2014 07:24 PM, Yury Gribov wrote: On 10/13/2014 02:26 PM, Yury Gribov wrote: On 10/02/2014 09:14 PM, Yury Gribov wrote: On 09/17/2014 09:08 PM, Yury Gribov wrote: > On 09/16/2014 08:38 PM, Yury Gribov wrote: >> Hi all, >> >> This is the third version of the patch. A list of changes

[PATCHv5][PING^2] Vimrc config with GNU formatting

2014-10-21 Thread Yury Gribov
On 10/13/2014 02:26 PM, Yury Gribov wrote: On 10/02/2014 09:14 PM, Yury Gribov wrote: On 09/17/2014 09:08 PM, Yury Gribov wrote: > On 09/16/2014 08:38 PM, Yury Gribov wrote: >> Hi all, >> >> This is the third version of the patch. A list of changes since last >> version: >> * move config t

[PATCHv5][PING] Vimrc config with GNU formatting

2014-10-13 Thread Yury Gribov
On 10/02/2014 09:14 PM, Yury Gribov wrote: On 09/17/2014 09:08 PM, Yury Gribov wrote: > On 09/16/2014 08:38 PM, Yury Gribov wrote: >> Hi all, >> >> This is the third version of the patch. A list of changes since last >> version: >> * move config to contrib so that it's _not_ enabled by defa

[PATCHv5] Vimrc config with GNU formatting

2014-10-02 Thread Yury Gribov
On 09/17/2014 09:08 PM, Yury Gribov wrote: > On 09/16/2014 08:38 PM, Yury Gribov wrote: >> Hi all, >> >> This is the third version of the patch. A list of changes since last >> version: >> * move config to contrib so that it's _not_ enabled by default (current >> score is 2/1 in favor of no Vim co

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-19 Thread Segher Boessenkool
On Fri, Sep 19, 2014 at 08:17:28AM +0400, Yury Gribov wrote: > > I was talking about mbr's plugin here :-) > > Ah, ok. Then I'll mention thinca's plugin as a secondary option with a > disclaimer then. Why? There are more plugins that also do the same thing, all more popular (on vim.org at least

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-18 Thread Yury Gribov
On 09/18/2014 09:20 PM, Segher Boessenkool wrote: > On Thu, Sep 18, 2014 at 12:40:08PM +0400, Yury Gribov wrote: >> When typing 'make .local.vimrc' in GCC build directory one would expect >> .local.vimrc to be created at the root of build directory, not srcdir. > > Yes, you would not expect it to

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-18 Thread Segher Boessenkool
On Thu, Sep 18, 2014 at 12:40:08PM +0400, Yury Gribov wrote: > When typing 'make .local.vimrc' in GCC build directory one would expect > .local.vimrc to be created at the root of build directory, not srcdir. Yes, you would not expect it to do anything to your source dir, ever :-) > >> +" To enabl

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-18 Thread Mike Stump
On Sep 18, 2014, at 1:40 AM, Yury Gribov wrote: > How about adding a disclaimer? E.g. "beware that Vim plugins are a GAPING > SECURITY HOLE > so use the at YOUR OWN RISK". (And note that Braun's plugin does use > sandboxes). Building gcc features a security risk at least as big as a plugin for

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-18 Thread Yury Gribov
On 09/18/2014 07:52 AM, Segher Boessenkool wrote:>> +# Local Vim config >> + >> +vimrc: >> + (cd $(srcdir); $(LN_S) contrib/vimrc .local.vimrc; $(LN_S) contrib/vimrc .lvimrc) >> + > > This is another target than what the doc (in the script itself) mentions. Right, I've forgot to fix it before s

Re: [PATCHv4] Vimrc config with GNU formatting

2014-09-17 Thread Segher Boessenkool
On Wed, Sep 17, 2014 at 09:08:44PM +0400, Yury Gribov wrote: [ Use a proper mime type and target-disposition inline, as contribute.html tells you. Or use a saner email client; since you're using git, try git send-email perhaps? Thanks. ] > index f7c7e38..ee2321f 100644 > --- a/Makefile.tpl > ++

[PATCHv4] Vimrc config with GNU formatting

2014-09-17 Thread Yury Gribov
On 09/16/2014 08:38 PM, Yury Gribov wrote: Hi all, This is the third version of the patch. A list of changes since last version: * move config to contrib so that it's _not_ enabled by default (current score is 2/1 in favor of no Vim config by default) * update Makefile.in to make .local.vimrc if

Re: [PATCHv3] Vimrc config with GNU formatting

2014-09-17 Thread Yury Gribov
Sure. If you have the localrc thing installed, anyone who can write files you can read can make your vim do *anything* (and I mean *anything*). I thought that modern versions of localrc run .local.vimrc scripts in a sandbox? Ok, looks like Markus Braun's http://www.vim.org/scripts/script.php

Re: [PATCHv3] Vimrc config with GNU formatting

2014-09-17 Thread Yury Gribov
On 09/17/2014 05:01 PM, Segher Boessenkool wrote: You can make Vim automatically adapt settings, but you cannot make the Vim user adapt to that. How about making Vim user adapt to GNU coding style though? Not that I want to start flame again. Sure. If you have the localrc thing installed, an

Re: [PATCHv3] Vimrc config with GNU formatting

2014-09-17 Thread Segher Boessenkool
On Tue, Sep 16, 2014 at 05:58:58PM -0400, Trevor Saunders wrote: > fwiw, I think enabling it by default especially when that really means > enable it if you've enabled the localrc plugin makes sense. Enabling it by default means enabling it for all users. That is a really really bad plan; many of

Re: [PATCHv3] Vimrc config with GNU formatting

2014-09-16 Thread Trevor Saunders
On Tue, Sep 16, 2014 at 08:38:58PM +0400, Yury Gribov wrote: > Hi all, > > This is the third version of the patch. A list of changes since last > version: > * move config to contrib so that it's _not_ enabled by default (current > score is 2/1 in favor of no Vim config by default) fwiw, I think e

[PATCHv3] Vimrc config with GNU formatting

2014-09-16 Thread Yury Gribov
Hi all, This is the third version of the patch. A list of changes since last version: * move config to contrib so that it's _not_ enabled by default (current score is 2/1 in favor of no Vim config by default) * update Makefile.in to make .local.vimrc if developer asks for it * disable autoform

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-15 Thread Yury Gribov
On 09/14/2014 02:30 PM, Alexander Monakov wrote: On Thu, 11 Sep 2014, Yury Gribov wrote: Ok, it tooks some time. Basically we want brace symbol to behave differently in two contexts: 1) not add any additional offset when not following control flow operator: void f () { int x; { } } N

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-14 Thread Alexander Monakov
On Thu, 11 Sep 2014, Yury Gribov wrote: > Ok, it tooks some time. Basically we want brace symbol to behave differently > in two contexts: > > 1) not add any additional offset when not following control flow operator: > void > f () > { > int x; > { > } > } Note that GCC commonly uses custom

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread Yury Gribov
On 09/11/2014 02:10 PM, Yury Gribov wrote: On 09/11/2014 01:18 PM, Richard Biener wrote: On Thu, Sep 11, 2014 at 11:06 AM, Richard Biener wrote: >On Wed, Sep 10, 2014 at 10:09 AM, Yury Gribov wrote: >>Hi all, >> >>This is a second version of patch which adds a Vim config (.local.vimrc) >>to r

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread Yury Gribov
On 09/11/2014 01:18 PM, Richard Biener wrote: On Thu, Sep 11, 2014 at 11:06 AM, Richard Biener wrote: >On Wed, Sep 10, 2014 at 10:09 AM, Yury Gribov wrote: >>Hi all, >> >>This is a second version of patch which adds a Vim config (.local.vimrc) >>to root folder to allow automatic setup of GNU

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread Yury Gribov
On 09/11/2014 01:14 PM, pins...@gmail.com wrote: I don't like auto formatting in any editor. Ok, so +1 for moving to contrib/. And some folks already have to deal with two more formatting styles already: Linux kernel and gnu. So if you add auto formatting to one, some folks are going to get c

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread Richard Biener
On Thu, Sep 11, 2014 at 11:06 AM, Richard Biener wrote: > On Wed, Sep 10, 2014 at 10:09 AM, Yury Gribov wrote: >> Hi all, >> >> This is a second version of patch which adds a Vim config (.local.vimrc) >> to root folder to allow automatic setup of GNU formatting for C/C++/Java/Lex >> GCC files. >>

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread pinskia
> On Sep 10, 2014, at 9:47 PM, Yury Gribov wrote: > > Segher Boessenkool kernel.crashing.org> writes: >> I am saying it is very anti-social to make >> people's editor behave differently from what they are used to. >> ... >> The Emacs dir-locals file simply >> configures some settings for files

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-11 Thread Richard Biener
On Wed, Sep 10, 2014 at 10:09 AM, Yury Gribov wrote: > Hi all, > > This is a second version of patch which adds a Vim config (.local.vimrc) > to root folder to allow automatic setup of GNU formatting for C/C++/Java/Lex > GCC files. > > I've updated the code with comments from Richard and Bernhard

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-10 Thread Yury Gribov
Segher Boessenkool kernel.crashing.org> writes: > I am saying it is very anti-social to make > people's editor behave differently from what they are used to. > ... > The Emacs dir-locals file simply > configures some settings for files with certain major modes in that dir. > For example, ours say

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-10 Thread Segher Boessenkool
On Wed, Sep 10, 2014 at 12:09:25PM +0400, Yury Gribov wrote: > The patch caused a lively debate with Segher who wanted .local.vimrc to > not be enabled > by default. No, that is not what I said. I am saying it is very anti-social to make people's editor behave differently from what they are used

Re: [PATCHv2] Vimrc config with GNU formatting

2014-09-10 Thread Yury Gribov
> I personally prefer 2) Sorry, I meant 1) of course that is enable vimrc config by default. -Y

[PATCHv2] Vimrc config with GNU formatting

2014-09-10 Thread Yury Gribov
Hi all, This is a second version of patch which adds a Vim config (.local.vimrc) to root folder to allow automatic setup of GNU formatting for C/C++/Java/Lex GCC files. I've updated the code with comments from Richard and Bernhard (which fixed formatting of lonely closing bracket). The patc

Re: Vimrc config with GNU formatting

2014-09-07 Thread Segher Boessenkool
On Sun, Sep 07, 2014 at 08:18:39AM +0400, Yuri Gribov wrote: > >> Hm, isn't it already enabled by default for Emacs (in .dirs-local.el)? > > > > That may well be. But Vim is not Emacs. > > Why is Vim special? Because you are changing the editor behaviour for Vim users. Duh. > > This all should

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yuri Gribov
On Sun, Sep 7, 2014 at 8:18 AM, Yuri Gribov wrote: > Replying to all this time. > > On Sat, Sep 6, 2014 at 11:35 PM, Segher Boessenkool > wrote: >>> Hm, isn't it already enabled by default for Emacs (in .dirs-local.el)? >> >> That may well be. But Vim is not Emacs. > > Why is Vim special? As a d

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yuri Gribov
Replying to all this time. On Sat, Sep 6, 2014 at 11:35 PM, Segher Boessenkool wrote: >> Hm, isn't it already enabled by default for Emacs (in .dirs-local.el)? > > That may well be. But Vim is not Emacs. Why is Vim special? As a developer I'd prefer the unified approach: either nuke both or mov

Re: Vimrc config with GNU formatting

2014-09-06 Thread Segher Boessenkool
On Sat, Sep 06, 2014 at 03:38:31PM +, Yury Gribov wrote: > Segher Boessenkool kernel.crashing.org> writes: > > On Fri, Sep 05, 2014 at 07:10:02PM +0400, Yury Gribov wrote: > > > Now I don't quite like the idea of plugin: > > > > Anything that will make this enabled automatically will meet a l

Re: Vimrc config with GNU formatting

2014-09-06 Thread Trevor Saunders
On Sat, Sep 06, 2014 at 03:38:31PM +, Yury Gribov wrote: > Segher Boessenkool kernel.crashing.org> writes: > > On Fri, Sep 05, 2014 at 07:10:02PM +0400, Yury Gribov wrote: > > > Now I don't quite like the idea of plugin: > > > > Anything that will make this enabled automatically will meet a l

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yury Gribov
Bernhard Reutner-Fischer gmail.com> writes: > > * gcc_style.vim enables GNU style globally, for all projects > > How come? Please explain? My understanding was that maybe_gcc_style gets run on all opened files and this could cause problems with non-GCC projects. But given that you check for GC

Re: Vimrc config with GNU formatting

2014-09-06 Thread Yury Gribov
Segher Boessenkool kernel.crashing.org> writes: > On Fri, Sep 05, 2014 at 07:10:02PM +0400, Yury Gribov wrote: > > Now I don't quite like the idea of plugin: > > Anything that will make this enabled automatically will meet a lot of > resistance. Make something nice for contrib/ instead? Hm, isn

Re: Vimrc config with GNU formatting

2014-09-05 Thread Segher Boessenkool
On Fri, Sep 05, 2014 at 07:10:02PM +0400, Yury Gribov wrote: > Now I don't quite like the idea of plugin: Anything that will make this enabled automatically will meet a lot of resistance. Make something nice for contrib/ instead? Segher

Re: Vimrc config with GNU formatting

2014-09-05 Thread Bernhard Reutner-Fischer
On 5 September 2014 17:10, Yury Gribov wrote: > Now I don't quite like the idea of plugin: > * .local.vimrc setting is more compatible with what we already have for > Emacs > * gcc_style.vim won't work for new files (it requires GCC license agreement) true > * gcc_style.vim enables GNU style gl

Re: Vimrc config with GNU formatting

2014-09-05 Thread Yury Gribov
On 09/05/2014 12:22 AM, Bernhard Reutner-Fischer wrote: Not sure from whom i borrowed this, perhaps even from you richi, but the gcc_style.vim pasted in the mail below seems to be floating around ;) https://gcc.gnu.org/ml/gcc-patches/2012-12/msg01228.html Nice! Interestingly enough this gives

Re: Vimrc config with GNU formatting

2014-09-05 Thread Yury Gribov
On 09/04/2014 05:22 PM, Richard Biener wrote: For some reason I use set shiftwidth=4 set tabstop=8 set autoindent set cinoptions={.5s,g0,p5,t0,(0,^-0.5s,n-0.5s I note some differences to your + setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 Ah, the vimfu. So the differe

Re: Vimrc config with GNU formatting

2014-09-04 Thread Bernhard Reutner-Fischer
On Thu, Sep 04, 2014 at 03:22:15PM +0200, Richard Biener wrote: > On Thu, Sep 4, 2014 at 3:06 PM, Yury Gribov wrote: > > Hi all, > > > > This patch adds a Vim config (.local.vimrc) to root folder. This would allow > > automatic setup of GNU formatting for C/C++/Java/Lex files in GCC (similar > > t

Re: Vimrc config with GNU formatting

2014-09-04 Thread Richard Biener
On Thu, Sep 4, 2014 at 3:06 PM, Yury Gribov wrote: > Hi all, > > This patch adds a Vim config (.local.vimrc) to root folder. This would allow > automatic setup of GNU formatting for C/C++/Java/Lex files in GCC (similar > to what we already have for Emacs via .dir-locals.el). The formatting is > bo

Vimrc config with GNU formatting

2014-09-04 Thread Yury Gribov
Hi all, This patch adds a Vim config (.local.vimrc) to root folder. This would allow automatic setup of GNU formatting for C/C++/Java/Lex files in GCC (similar to what we already have for Emacs via .dir-locals.el). The formatting is borrowed from https://gcc.gnu.org/wiki/FormattingCodeForGCC