Re: [RFC] Balsa coding style

Hi Albrecht:

On 03/12/2016 12:53:22 PM Sat, Albrecht Dreß wrote:
PING - any comment from the project admins would be appreciated, also if you think this is complete nonsense.

Am 20.02.16 17:59 schrieb(en) Albrecht Dreß:
Hi all,

the balsa 'HACKING' file states

The coding style used in Balsa currently is a bit of a mess.

which is actually true... ;-)  I use Eclipse as development platform, and could not find a setting which 
displays /all/ files properly.

The same document states that the indent command

        indent -kr -i4 -psl

shall be used which seems to limit the line length to 72.  This was actually suitable for a 1024x768 screen, 
but seems to be too limited these days IMHO.  Actually, the short line wrapping makes reading the code very 

What do you think about extending the indent statement above to a line length of, say, 132, and fixing the 
tab width to e.g. 4, i.e.:

        indent -kr -i4 -l132 -lc132 -ts4 -psl

and re-indent all files in the repository?

I tried:

[me home balsa]$ find . -name '*.[ch]' -exec  indent -kr -i4 -l132 -lc132 -ts4 -psl '{}' ';'
indent: ./libbalsa/libbalsa-gpgme-cb.h:55: Error:Stmt nesting error.
indent: ./libbalsa/imap/imap-handle.c:1843: Warning:old style assignment ambiguity in "=-".  Assuming "= -"
indent: ./src/main-window.c:5112: Error:Unexpected end of file

The first of these seems to be another of the MAKE_EMACS_HAPPY hacks. The second looks like a correct 
assumption! The third I believe to be caused by some conditionally compiled code that is straight line code 
under one condition and an if/else clause in another, with some cleverly placed curly brackets to make it 
build in either case. We should probably simplify the conditioning, at the cost of duplicating those lines.

Otherwise, I like the look of the cleaned up code! You're right, it would ease maintenance considerably. I 
suppose vim will wrap incorrectly (unless there's a way to set the wrap length specifically for C files), but 
I can always pipe through indent.

So I'm inclined to go with it. Anyone else want to comment?


Attachment: pgpvyfQvnoafL.pgp
Description: PGP signature

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