X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Fapply-context.ly;h=abcbd3028165077e2555452d23d8ce2ade465238;hb=74b008a3d5f390a0429dd8fab7dd20f2704e826b;hp=2cf54b1b9915f21c8c2836b0ba3d3a1d902a192d;hpb=6349772d0e909b2d9edbb3cf5e50a1f18ed77c5e;p=lilypond.git diff --git a/input/regression/apply-context.ly b/input/regression/apply-context.ly index 2cf54b1b99..abcbd30281 100644 --- a/input/regression/apply-context.ly +++ b/input/regression/apply-context.ly @@ -1,22 +1,30 @@ + +\version "2.10.0" + + \header { -texidoc = "with \\applycontext, \\properties can be modified +texidoc = "With @code{\\applyContext}, @code{\\properties} can be modified procedurally. Applications include: checking bar numbers, smart -octavation. " +octavation. + + +This example prints a bar-number during processing on stdout. +" } -\score { \notes \relative c'' { - c1 c1 +\layout { ragged-right= ##t } + - %% todo: should put something interesting in the .tex output. - - \applycontext #(lambda (tr) - (let* ((bn (ly:get-context-property tr 'currentBarNumber))) - (if (= bn 3) - #t - (format #t "We were called in ~a" bn)) - )) +\relative c'' { + c1 c1 - c1 c1 -}} + %% todo: should put something interesting in the .tex output. + + \applyContext + #(lambda (tr) + (ly:progress "\nWe were called in bar number ~a.\n" + (ly:context-property tr 'currentBarNumber))) + c1 c1 +}