Brian Jones wrote:

> You should keep the reformatting separate from a code change if at all
> possible just so it is more clear in looking at CVS with diff/logs.
> 
> Is there a mode in standard GNU indent which meets the right
> formatting criteria for Java code and GNU standards?


GNU indent doesn't handle Java well, unfortunately (at least, the last time I 
checked).  But I have discovered "astyle" 
http://www.bigfoot.com/~davidsont/astyle which works relatively well.  It has 
supports the GNU style.

Personally, I use the following options, which give preety good results 
(relatively conform to the GNU style):

astyle -jbs2

It has a small glitch; it sometimes adds spurious blank lines, so applying 
astyle to a file repeatedly adds a block of empty lines.  These lines are easily 
removed by a small program which removes blocks of empty lines [I have written one].

Astyle does't go as far as GNU indent for controling the indentation of code 
"within" a line of code (e.g. space before parentheses, etc.).  But it is much 
better than nothing!

Etienne
-- 
Etienne M. Gagnon                    http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to