bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-indent] brace-line-up feature mod for indent


From: Daniel Gryniewicz
Subject: Re: [Bug-indent] brace-line-up feature mod for indent
Date: 24 Jul 2002 15:42:30 -0400

This is not what the patch does.  With the patch, you use -bl -bli2 -blu
-i2 and get this:

if (x > 0)
  {
  x--;
  }
else
  x++;


You cannot do this with indent as it is.  If you use -bl -bli2 -i0 you
will get this:
if (x > 0)
  {
  x--;
  }
else
x++;

If you use -bl -bli2 -i2, you will get this
if (x > 0)
  {
    x--;
  }
else
  x++;

Do you see the difference?  I have been unable to get the first form. 
The included documentation (which I did read) and the code (which I also
read) don't seem to allow it.  If it's possible, please enlighten me,
and I'll use that.

Daniel

On Wed, 2002-07-24 at 13:50, david ingamells wrote:
> Daniel,
> Thank you for you efforts. However this feature is already present in indent, 
> as you would have seen if you had studied the documentation. Here is the 
> appropriate text:
> 
> ==============================
> if (x > 0)
>   {
>     x--;
>   }
> 
> 
> If you use the `-bl' option, you may also want to specify the `-bli' option. 
> This option specifies the number of spaces by which braces are indented. 
> `-bli2', the default, gives the result shown above.
> ===========================
> 
> I will therefore not need your patch.
> David.
> 
> On Saturday 20 July 2002 1:40 am, Daniel Gryniewicz wrote:
> > Hi.
> >
> > I tried to make a indent script for my coding style, and was surprised
> > to find out that it has no way of making braces line up with the code
> > they're surrounding.  I've added a new option, which does this:
> >
> > if (blah)
> >     {
> >     do_something();
> >     }
> >
> > The options is name -blu (-brace-line-up) and it implies -bl.  What it
> > does is not indent code after indenting the brace.  It defaults to off.
> > Feel free to use the code or not, or use the idea or not, it's up to
> > you.  However, as Vim will format code in this manner, and it's a
> > not-uncommon coding style, I think it would be nice to include the
> > capability in indent.  If necessary, I will assign copyright to GNU.
> >
> > Daniel
> 
> -- 
> David Ingamells
> address@hidden
> +31 (013) 5093388     (home)
> +31 615010947 (mobile)
-- 
Recursion n.:
        See Recursion.
                        -- Random Shack Data Processing Dictionary





reply via email to

[Prev in Thread] Current Thread [Next in Thread]