On Fri, Sep 24, 2010 at 10:51:43AM +0200, Paolo Bonzini wrote:
> On 09/23/2010 08:49 PM, Ian Lance Taylor wrote:
> >Diego Novillo<dnovi...@google.com>  writes:
> >
> >>I'd suggest sending one initial patch fixing indentation issues and
> >>then sending your functional changes on top of the first patch.
> >
> >Yes.

I did that already:
http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01891.html improved in
http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01918.html

The patch was made by first running GNU indent (with the options
outlined in http://gcc.gnu.org/ml/gcc/2010-09/msg00448.html) then
looking at the diff and tweaking identation manually, and at last
using Emacs M-x mark-whole-buffer followed by M-x indent-region. Do
you have a more useful *concrete* advice (i.e. what Emacs actions are
you suggesting)?

> >
> >Basile, I'm sorry you have to struggle with some poor existing
> >indentation in gengtype.c, but the GNU style indentation is not all that
> >hard.  It is documented here:
> >
> >http://www.gnu.org/prep/standards/html_node/Formatting.html
> >http://gcc.gnu.org/codingconventions.html

I did read both pages several times. But I do believe that the current
gengtype has flawed indentation (and keeping the indentation errors to
minimize patch length is too hard for me).  And since I am typing my
code with emacs (my ~/.emacs is given
http://gcc.gnu.org/ml/gcc/2010-09/msg00448.html and seems fully
compliant with GCC habits since all the indentation related code is
taken from gcc.gnu.org site) I am indeed expecting the Emacs editor to
help on indentation issues. However, doing that make my diff much
bigger, since they ipso facto have indentation differences
w.r.t. existing badly indented gengtype source code.

> 
> I think that this is all good but it can be done as a single patch
> after Basile's work has been committed.  We usually try hard to get
> indentation right, but given the history of gengtype it would make
> sense to give him an exception on this.
> 
> Note that unlike "indent", Emacs's indent-region usually does the
> right thing as it doesn't try to fix brace styles, spacing around
> operators and parentheses, and long lines (only indentation).
> However, even then it would complicate a lot Basile's work.


I don't understand what concrete steps are you suggesting. As
explained above, I am using M-x indent-region but it does indent
gengtype code because gengtype is mis-indented from the beginning.

Maybe my patches will never go into trunk because of indentation
issues (I cannot afford indenting manually each line of my patch
series, by typing the appropriate number of spaces. I need a tool or
methodology to help.).

Cheers.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

Reply via email to