2.6.1 Context evaluation

Contexts can be modified during interpretation with Scheme code. The syntax for this is

\applyContext function

function should be a Scheme function that takes a single argument: the context in which the \applyContext command is being called. The following code will print the current bar number on the standard output during the compile:

  #(lambda (x)
    (format #t "\nWe were called in barnumber ~a.\n"
     (ly:context-property x 'currentBarNumber)))

Other languages: deutsch, español, français.
About automatic language selection.

LilyPond — Extending v2.17.97 (development-branch).