logo       

Re: Indenting the source: msg#00040

lang.nasm.devel

Subject: Re: Indenting the source

H. Peter Anvin wrote:
Ed Beroset wrote:


I think you may misunderstand the difference. The -ci8 is just the *continuation* indent, meaning a single long line of code is wrapped and indented by 8. The -i4 means that the normal indentation is still 4, as we both have indicated we prefer. Most of the code seems to be in that style already.

Also, by preferring -lp instead of -nlp, you actually leave less room for comments, not more. The example statements above illustrate both of these points. The -lp version has the function arguments lined up vertically, and the -nlp -ci8 just indents the second line by 8 spaces instead as many as it takes to line up the parameters.


Ah yes. I really want the arguments to line up, even though it makes less room for comments. Otherwise it looks like a hanging statement (like a braceless if.)

What I got confused by was that your example had a space between the function name and the parenthesis. That space is a very bad thing in my opinion.

Well then, here's a compromise that you can probably live with: I had -ci8 -nlp and you had -ci4 -lp, so let's use -ci8 -lp. That way the arguments will line up as you like, but other kinds of continued statements have an extra level of indentation. I find this makes it easier to spot multiline statements than if all are at the same indentation level. So the whole nine yards now looks like this:

indent -kr -i4 -ts8 -nut -sob -ss -ncs -ci8

Any objections?

Ed



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise