Use ‘m4’ as preprocessor to create a single-file noweb source

Using the “project” file to set the order of the noweb source files to
concatenate is very fragile, given how easy is to inadvertently trigger a
reordering in Vim; requires the use of silly files such as one with a single
‘\appendix’ command in it; and it feels weird to have the document’s order
outside the document itself.

The most obvious way to structure large texts in separate chapters is to have
a top-level file that includes the other source using TeX’s ‘\include’
command.  However, this causes problems when weaving the documentation with
noweb because ‘noweave’ doesn’t understand neither ‘\include’ nor ‘\input’
forcing me to either concatenate the source files into a single noweb document
or passing all the files as parameters to ‘noweave’.  In both cases I am
screwed if the ‘\end{document}’ comes before any of the chapters causing LaTeX
to fail later when generating the PDF output; that’s why I ended up with the
awkward “project” file.

The solution comes realizing that what I really need is a kind of preprocessor
that puts the content of the included files at the position where the
directives are written at--much like C’s preprocessor ‘#include’ directives.
That way I end up with a single long text that I can pipe to ‘noweave’
producing a single LaTeX file that ‘pdflatex’ is able to parse correctly.  A
priori, it seems quite easy to write a little application that looks for the
correct and “includes” the file mentioned, but it is way easier to use an
already made preprocessor such as ‘cpp’ or ‘m4’.  I’ve chosen the latter
because it is slightly more powerful and faster--by a very close margin, but
faster.

The only problem that ‘m4’ has--as I force ‘m4’ to use the ‘m4_’ prefix to all
built-in comments to prevent unwanted macro expansion--is that the quote
characters matches LaTeX’s apostrophe characters (‘`’ and ‘'’).  Actually, I
usually don’t use those characters preferring to use the “real” ones, but I
had to change the text for the GPL and CCPL licenses to avoid erroneous
quotation marks in the final text.

--HG--
branch : noweb
rename : noweb/acronms.nw => noweb/acronyms.nw
rename : noweb/preamble.nw => noweb/shmup.nw
Fixed a left-over from a debug session in weave.sh

--HG--
branch : noweb
Added ‘clean.sh’ and ‘tangle.sh’ scripts.

‘tangle.sh’ preprocesses the noweb file into a temporary file and then looks
for all the “root fragments” (i.e., fragments that are not referenced from
another) that have no whitespace and assumes that they are the chunks to
tangle to files named after the fragment.  That means that all the root
fragments must be the name of a file--very common in literate programming--and
that the file names can’t contain spaces.

The space thing is because I have a tendency to have fragments that eventually
will be referenced and thus won’t be root, but that while development aren’t
referenced anywhere.  Sticking to the rule that actual root fragments (i.e.,
fragments with an output file ame) don’t have spaces but all the others have
makes easier to discern between the two even if both are returned by ‘noroot’.

Another particularity of ‘tangle.sh’ is that, unlike ‘noweb’, it creates the
directory where the output files will be written in.  And while it is doing
all of this, it also outputs the actions--either ‘TANGLE {file}’ or ‘MKDIR
{dir}’.  This output can easily parsed to reverse the actions and remove all
the tangled files; this is exactly what ‘clean.sh’ does.  With all the
generated files removed is less probable that I add them to the repository by
error.

--HG--
branch : noweb