2016-05-07 15:17 GMT+02:00 David Nalesnik <david.nales...@gmail.com>: > Hi Harm, > > On Sat, May 7, 2016 at 5:52 AM, Thomas Morley <thomasmorle...@gmail.com> > wrote: >> 2016-05-07 10:53 GMT+02:00 Peter Gentry <peter.gen...@sunscales.co.uk>: >> >>> Could I sugeest that the range data is input in the individual music file >>> rather than the procedure so that the procedure remains >>> unchanged for any arrangement of page ranges. It should be a minor addition >>> that would make the snippet much more usuable as one of >>> the staple includes. >>> >>> >> Hi Peter, >> >> not sure what you mean, could you elaborate more detailed? >> >> Anyway, I reworked it >> http://lsr.di.unimi.it/LSR/Item?u=1&id=1036 >> > > > Looks great! The comments below make some grammatical corrections. > Thanks for doing this! > > %%%%%%%%%%%%%%% > > #(define-markup-command (use-page-number-ranges layout props)() > "Reads @code{'page-number-ranges} from @var{layout} and transforms it into a > flat list of integers. Prints a number-string taken from this list for > page-numbering. > The values are referenced by the actual page-number. If all elements of this > list are consumed, additional pages are numbered consecutive. > > > ;;;; consecutive --> consecutively > > > An empty list will cause default page-numbers. Same for non-list settings or > unsetting of @code{'page-number-ranges} > > > ;;;; An empty list will cause default page-numbers, as will non-list settings > or > ;;;; unsetting of @code{'page-number-ranges} > > > Limitations: > - doesn't work for roman page-numbers. > - only integer page-numbers are supported" > > (define (page-numbers ranges) > ;; get a flat, unfolded list from a list containing ranges of integers. > ;; p.e. '((1) (3 5) (7 10)) -> '(1 3 4 5 7 8 9 10) > (append-map > (lambda (e) > (if (every integer? e) > (iota (- (last e) (1- (car e))) (car e) 1) > (ly:error "All elements needs to be integers: ~a" e))) > > > ;;;; needs --> need > > > ranges)) > > > [snip] > > %%%%%%%%%%%%%%%%%% > > Best, > David
All done as suggested. I'll let it unapproved for few more days in case somebody comes up with further suggestions. Thanks a lot for review., Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user