Artistic Style indenter/formatter take #2

Tal Davidson davidsont at bigfoot.com
Tue Sep 21 18:47:47 BST 1999


Bernd,

By "Reindenting" I mean adjusting the "white space" indentation of lines.
By "Reformatting" I mean making subtle changes in the code itself, such as
inserting new newlines and removing others,
or inserting spaces and removing others, in order to make the code comply to
a specific style.

Example:

Changing the ANSI style

int Foo()
{
    if (x > y)
    {
        a;
    }
    else
    {
        b;
    }
}

to the Ritchie/Keringhan style

int Foo() {
    if (x > y) {
        a;
    } else {
        b;
    }
}

or to the linux style

int Foo()
{
    if (x > y) {
        a;
    } else {
        b;
    }
}

Hope that helps,
Tal

----- Original Message -----
From: Bernd Gehrmann <bernd at physik.hu-berlin.de>
To: <kdevelop at barney.cs.uni-potsdam.de>
Sent: Tuesday, September 21, 1999 11:55 AM
Subject: Re: Artistic Style indenter/formatter take #2


> On Tue, 21 Sep 1999, Tal Davidson wrote:
>
> > No, I was thinking about reformatting the whole buffer each time
> > reformatting
> > specifically is asked for
> > (as in when its menu item is selected, or its toolbar item is pressed,
> > etc...
>
> Mmh, maybe I misunderstand what you mean by 'reformat' and
> 'reindent'. If for you reformatting is "going through the
> code and adjust the indentation of each line" and reindenting
> is "adjusting the indentation of a given line by looking at
> its context", then I don't understand why you think that the
> latter is not really needed. For me, the lack of this feature
> (and the lack of incremental search) is one of the killer
> criteria against kwrite.
>
> Bernd.
>
>
>




More information about the KDevelop mailing list