From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12402 invoked by alias); 11 Sep 2014 09:18:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12388 invoked by uid 89); 11 Sep 2014 09:18:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f42.google.com Received: from mail-wg0-f42.google.com (HELO mail-wg0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 11 Sep 2014 09:18:09 +0000 Received: by mail-wg0-f42.google.com with SMTP id x12so7209642wgg.1 for ; Thu, 11 Sep 2014 02:18:06 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.191.135 with SMTP id gy7mr11360837wjc.39.1410427086664; Thu, 11 Sep 2014 02:18:06 -0700 (PDT) Received: by 10.194.20.69 with HTTP; Thu, 11 Sep 2014 02:18:06 -0700 (PDT) In-Reply-To: References: <540863C1.4000909@samsung.com> <54100735.5040700@samsung.com> Date: Thu, 11 Sep 2014 09:18:00 -0000 Message-ID: Subject: Re: [PATCHv2] Vimrc config with GNU formatting From: Richard Biener To: Yury Gribov Cc: GCC Patches , Laurynas Biveinis , Jeff Law , Segher Boessenkool , Bernhard Reutner-Fischer , Trevor Saunders , Mike Stump Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00891.txt.bz2 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. >> >> I've updated the code with comments from Richard and Bernhard (which fixed >> formatting >> of lonely closing bracket). >> >> The patch caused a lively debate with Segher who wanted .local.vimrc to not >> be enabled >> by default. We basically have two options: >> 1) put .local.vimrc to root (just like .dir-locals.el config for Emacs) >> 2) put both .local.vimrc and .dir-locals.el to contrib and add Makefile >> targets >> to create symlinks in root folder per user's request >> I personally prefer 2) because this would IMHO improve the quality of >> patches >> (e.g. no more silly tab-whitespace formatting bugs). >> >> Thoughts? Ok to commit? > > It doesn't handle indenting switch/case correctly. I get > > switch (x) > { > case X: > { > int foo; > ... > > that is, the { after the case label is wrongly indented. The same happens > for > { > { > } > } > > we seem to get two soft-tabs here. setlocal cinoptions=>s,n-s,{s,:s,=s,g0,hs,p5,t0,+s,(0,u0,w1,m0 does better but still oddly handles switch (x) { case X: { tree x; thus indents a brace two spaces too much (but the stmts are correctly indented). The following is handled fine: switch (x) { case X: foo (); Richard. > Richard. > >> -Y >> >> >>