Re: [frogs] Re: Naming output files |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: frogs@xxxxxxxxxxx, "Carl D. Sorensen" <c_sorensen@xxxxxxx>, Reinhold Kainhofer <reinhold@xxxxxxxxxxxxx>
- Subject: Re: [frogs] Re: Naming output files
- From: Valentin Villenave <v.villenave@xxxxxxxxx>
- Date: Mon, 2 Mar 2009 11:11:53 +0100
- Cc: lilypond-user@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lvJ2Gbw7BPVoLCTz637MOkhPiIGLIK6n8vJzX4Sg8c0=; b=vNDD7egeLJ5SupS/oJPoFmihjnw1BM+2jIr4jqU5sX3u9ePgvv4tI32XemgEeZjq3w vLrGEwG10f3Qrag0hBNSixY2Bkpvj6azQRKkR6SspuiVKbMIDfOriDY3hvbJ0s5pQ0CO Qwhw6rAhvhOE3C8C1v8RXtV5u1Hfj2JBIvzBM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=K+dfm3M5dojv/2wY+oEYgsQc4dkA3krNgOlp7JjcNRei6FYFQ8HZUFDnyLJA88UaMM 9CGrLoo+V00YMYDyzTEQCuAjnrE279ZH8j7V1pDt3wW6OQ7xPfUwHn1qxAvDbQDkKMy6 tY/TwnAJJBetBBxYF1+D7z72YWjybGp6Xxie8=
2009/2/26 Marek Klein <marek@xxxxxxxxxxxxx>:
>
> now it works as expected:
>
> (define counter-alist '())
>
> (define (print-book-with parser book process-procedure)
> (let*
> ((paper (ly:parser-lookup parser '$defaultpaper))
> (layout (ly:parser-lookup parser '$defaultlayout))
> (output-suffix (ly:parser-lookup parser 'output-suffix))
> (output-count (assoc-ref counter-alist output-suffix))
> (base (ly:parser-output-name parser)) )
>
> (if (string? output-suffix)
> (set! base (format "~a-~a" base (string-regexp-substitute
> "[^a-zA-Z0-9-]" "_" output-suffix))))
>
> ;; must be careful: output-count is under user control..
> (if (not (integer? output-count))
> (set! output-count 0))
>
> (if (> output-count 0)
> (set! base (format #f "~a-~a" base output-count)))
> (set! counter-alist (assoc-set! counter-alist output-suffix (1+
> output-count)))
>
> What about set! versus ly:parser-define! ?
Well done Marek!
Carl, Reinhold, should I open a tracker issue or will this fix get merged soon?
Regards,
Valentin
---
----
Join the Frogs!