Commit ca62bd8bc703147314a94e20a4b4ea7c5a7b2d37

Improved the well-f. check to ignore filenames
(by implementing a more generic mechanism for checks).

Now the checks are assumed destructive, and the hold space is used in
the implementation.
  
4242##############################################
4343# N:
4444s|N|ŋ|g # velar or nasalization
45h # Save before the destructive checks (copy pattern space to hold space).
4546##########################################
46# Well-formedness of the input:
47# Well-formedness of the input (is checked destructively):
4748# - no ^'s should remain;
4849# - other capitals should not have been used (no S^, no C^ and no plain capitals);
4950# - more?
50/\$Date.*\$$/ n # skip the 'preamble'
51s|\$Date.*\$|| # ignore the 'preamble'
52s|\\url{.*}|| # ignore filenames, which have been marked up like this: \url{Komi_rus_slovar1.pdf}
5153/\^/ {
5254w /dev/stderr
5355q 56;} # (mostly GNU sed extensions)
5456/\(^\|[^\\]\)[[:upper:]]/ { # [^\\] -- a workaround for grammatical terms,
5557# to escape these restrictions on Latin characters: write them like \Pres, \Gen etc.
56# FIXME: I also use this workaround for filenames, e.g.: \Komi_rus_slovar1.pdf, but
57# this should be replaced for the sake of universality with smth like
58# \url{Komi_rus_slovar1.pdf}.
5958w /dev/stderr
6059q 57;} # (mostly GNU sed extensions)
60g # Restore after the destructive checks (copy/append hold space to pattern space).
6161"
6262
6363# FIXME: A "keep-going" mode: detect all the non-well-formednesses, and accumulate all