Re: Re: patch: MC for Win32



Hi, Andrew!

> >I'll have to get used to MC's official coding style 
> >(is there any **short** readme on this topic?)

No, but there is some traditional style used in the code.  My point was
not to use more than one statement on the same line because it's hard to
debug such code.  If you have something like

if (a == 0) {b = 1;} else {b = 2;}

then you cannot see which branch was actually executed by doing
single-stepping in gdb.

It is not about style, it's about respect to those who will debug your
code.

> What about .indent.pro sample?

I think this is quite close to the currently used indentation:

-kr -i4 -ts8 -nsob -l80 -ss -bs -psl -pcs

Not all files use line break before function name, but it's a good thing
for programs like etags.

I can put .indent.pro to every directory containing *.c and *.h except
vfs/samba and subdirectories (and even add it to the distribution so that
the users of releases could submit nicely formatted code).

Pressing Shift-F9 in the editor when the block is selected would invoke
indent, which would read .indent.pro, so you can re-format some parts of
the code instead of whole files.

-- 
Regards,
Pavel Roskin




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