Re: Lindent fixed to match reality

Erik Hensema
2004-01-29T20:37:18Z

Matt Mackall (mpm@selenic.com) wrote:
> I've been fiddling with cleaning up some old code here and suggest the
> following to make Lindent match actual practice more closely. This does:
>
> a) (no -psl)
>
> void *foo(void) {
>
> instead of
>
> void *
> foo(void) {

You just nicely broke 'find . -name *.c | xargs grep ^foo'.

Why make functions harder to find? It's just one line... Being
able to navigate the source tree with standard unix utils is a
Good Thing.

Even better, IMHO:

void *
foo(void)
{
}

Yes, that takes a full three lines. But within the function body
you can just reverse search for ^{ and you're at the function
declaration. Not nearly as useful as grepping for a function
name, but still a nice thing to have, IMHO.

>
> b) (no -bs) "sizeof(foo)" rather than "sizeof (foo)"

Agreed.

> c) (-ncs) "(void *)foo" rather than "(void *) foo"

Agreed.

--
Erik Hensema <erik@hensema.net>