[PD-dev] Tcl/Tk code formatting and file organization

Chris McCormick chris at mccormick.cx
Sun Jan 4 12:19:09 CET 2009

On Sat, Jan 03, 2009 at 01:48:11PM -0800, Miller Puckette wrote:
> > - second, I think we should use a similar tab format as the C side,  
> > but cleaner: 4 char tabs, all spaces or maybe all tabs.
> > 
> I've "always" used 4-character indents, no tabs (except for makefile.in :) 
> Various contributed code deviates from that, and when I have to actually look
> at it I feel at liberty to thrash it into the pd "standard".  There are some
> bits I'm afraid to touch, such as the ALSA MIDI code, since I don't have any
> setup on which to test it.

A bit OT, but if you're using vi, a quick and painless way to reformat
between all-tabs or all-spaces is the following:

:0,$s/    /\t/g    <- converts 4 spaces to a tab
:0,$s/\t/    /g    <- converts a tab to 4 spaces

In C code that won't break anything. You could also use the 'rpl'
command, or one of those fancy indent re-formatting programs. I am using
this all the time now as I belong to the religion of tabs, but the other
heathen at RjDj are spaces people. Of course, tabs are the One True Way,
and shall reign supreme at the return of the Tab King. You'll see.



More information about the Pd-dev mailing list