-----BEGIN PGP SIGNED MESSAGE-----
On Donnerstag, 26. Februar 2009 10:58:19 Mats Bengtsson wrote:
The obvious follow-up question is, why you get the additional number
even when the file name would
be unique without the number, i.e. when the output-suffix is set
differently for each book block.
I realize that it probably requires a few more lines of code in the
LilyPond implementation to handle
the book-keeping, but it would still be a valuable feature.
It would actually be quite simple to implement: In scm/lily-library.scm in the
print- book-with function, instead of storing the file count as a number in
'output-count, store it in an alist (which is set as the 'output-count parser
variable), with the suffix as key. This way, the counting is per suffix and
we'll automatically not append the number for the first file with a given
I think this would be quite a nice task or a frog, so I'm not coding it
myself, just giving a few pointers... The way to work with the alist (that's
Scheme's idea of a Hash) can be seen e.g. in my counter snippet on LSR:
All you need to do is to use assoc-ref instead of count and ly:parser-define!
(instead of the set! in the counter example) with assoc-set! to set one entry
of the hash / alist. The key for the alist would be the suffix. The rest of
the function doesn't even need to be changed...
PS: Why do we call (string-regexp-substitute "[^a-zA-Z0-9-]" "_" output-
suffix) on the suffix? This makes it impossible to use e.g. "Flöte" as the
suffix, which is German for Flute! Similar, any other accented or non-latin
letter is not possible and will be replaced by a "_". Similarly, spaces or +
etc. are also not allowed... I understand that some letters may cause problems
(in particular, ":", "/", "\" and maybe also "?" and "*"), but I don't think
this is a reason to prevent everything other than latin letters and numbers.
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
* Financial & Actuarial Math., Vienna Univ. of Technology, Austria
* http://www.fam.tuwien.ac.at/, DVR: 0005886
* LilyPond, Music typesetting, http://www.lilypond.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-----END PGP SIGNATURE-----