Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] C beautifier

86 views
Skip to first unread message

Francisco J Ballesteros

unread,
Sep 18, 2011, 2:10:51 PM9/18/11
to
Hi,

anyone is using a C beautifier in Plan 9?
I mean, other than gnu indent, which I tried and does not
work quite right for me.

thanks

andrey mirtchovski

unread,
Sep 18, 2011, 2:16:57 PM9/18/11
to
/386/bin/cb?

Francisco J Ballesteros

unread,
Sep 18, 2011, 2:21:07 PM9/18/11
to
I'll have to learn to search and read man pages :)

thanks!

On Sun, Sep 18, 2011 at 8:15 PM, andrey mirtchovski
<mirtc...@gmail.com> wrote:
> /386/bin/cb?
>
>

erik quanstrom

unread,
Sep 18, 2011, 2:21:11 PM9/18/11
to

cb has worked for me, even on windows code.

- erik

Francisco J Ballesteros

unread,
Sep 18, 2011, 2:25:06 PM9/18/11
to
I was looking for something capable of unifying say

if(...){
}else{
}

and

if(...)
{
}
else
{
}

into a single style.
But it might do. thanks again.

Francisco J Ballesteros

unread,
Sep 18, 2011, 2:34:30 PM9/18/11
to
As I said, I should learn to read man pages.
cb -s
was exactly what I was looking for.
thanks again.

Steve Simon

unread,
Sep 18, 2011, 4:02:45 PM9/18/11
to
I have an indent port in my contrib (though you say you don't like it),
and plan9 has cb(1).

what don't you like about indent?

I use it with erik's bcmt which replaces c++ style comments with C ones,
a carfully tailored proto file, and this: sed 's/\) {/){/
.

This gives me pretty much plan9-style code (assuming nix-style is plan9-style
and has not evolved).

-Steve

Francisco J Ballesteros

unread,
Sep 18, 2011, 4:06:45 PM9/18/11
to
Somehow indent has indented wrong some ifs
(the code in the body is at the same tab level than the if).
Perhaps I made a mistake. I'm not saying it doesn't work
(I'm sorry if I did).

but cb was just fine.

David Arnold

unread,
Sep 18, 2011, 4:15:50 PM9/18/11
to
On Sun Sep 18 14:10:06 EDT 2011, ne...@lsub.org wrote:

> anyone is using a C beautifier in Plan 9?
> I mean, other than gnu indent, which I tried and does not
> work quite right for me.

uncrustify is fairly flexible, but takes some work up front to describe your desired output style.

http://uncrustify.sourceforge.net/

d


Ethan Grammatikidis

unread,
Sep 22, 2011, 6:41:54 AM9/22/11
to
On Sun, 18 Sep 2011 22:05:24 +0200
Francisco J Ballesteros <ne...@lsub.org> wrote:

> Somehow indent has indented wrong some ifs
> (the code in the body is at the same tab level than the if).
> Perhaps I made a mistake. I'm not saying it doesn't work
> (I'm sorry if I did).
>
> but cb was just fine.

I've had indent fail on something I thought would be easily parsable.
All I remember is it got indentation wrong from a certain point up to
the end of the file, and simply removing a newline before a brace
nullified the error.

Somewhere I have a script which fed about a dozen options to indent to
get the style I wanted. It was a very clear style (unlike indent's
default) but I can't find it now. I suspect it's on my Zaurus and was
primarily intended to fit code to the 63-column xterm I prefered on
that device.

0 new messages