Or improve your google-fu by finding some existing tools that do the job right. :)<br><br>I&#39;m pretty sure Uncrustify is good at most of these issues, not to mention it&#39;s a very nice source-code &quot;prettifier/indenter&quot;. There&#39;s a front-end called UniversalIndentGUI, which has about a dozen integrated versions of source-code prettifiers (including uncrustify, and for many languages). It has varios settings on the left, and togglable *Live* preview mode which you can view on the right.<br>
<br>I invite you guys to try it out sometime:<br><br><a href="http://universalindent.sourceforge.net/">http://universalindent.sourceforge.net/</a><br><br>(+ you can save different settings which is neat when you&#39;re coding for different projects that have different &quot;code design &amp; look&quot; standards)<br>
<br><div class="gmail_quote">On Sat, Aug 7, 2010 at 3:50 AM, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 08/06/2010 08:34 PM, Walter Bright wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I wrote these two trivial utilities for the purpose of canonicalizing<br>
source code before checkins and to deal with FreeBSD&#39;s inability to deal<br>
with CRLF line endings, and because I can never figure out the right<br>
settings for git to make it do the canonicalization.<br>
<br>
tolf - converts LF, CR, and CRLF line endings to LF.<br>
<br>
detab - converts all tabs to the correct number of spaces. Assumes tabs<br>
are 8 column tabs. Removes trailing whitespace from lines.<br>
<br>
Posted here just in case someone wonders what they are.<br>
</blockquote></div>
[snip]<br>
<br>
Nice, though they don&#39;t account for multiline string literals.<br>
<br>
A good exercise would be rewriting these tools in idiomatic D2 and assess the differences.<br><font color="#888888">
<br>
<br>
Andrei<br>
</font></blockquote></div><br>