2014/1/9 David Kastrup <[email protected]>:
> Janek Warchoł <[email protected]> writes:
>
>> Hi,
>>
>> I want to create custom context definitions using a scheme function.
>> Later on the function will take some arguments and actually do
>> something interesting, but right now i cannot get the most basic
>> examples to work:
>>
>> %%%%% why the override isn't applied here?
>>
>> test =
>> #(define-scheme-function (parser location)()
>> #{
>> \layout {
>> \context {
>> \Staff
>> \override NoteHead #'color = #blue
>> }
>> }
>> #})
>>
>> \layout { \test }
>
> Presumably because Scheme expressions in layout definitions are not
> interpreted. That's similar to a few other places where a local module
> can be manipulated by Scheme expressions like #(set-staff-size) and
> similar stuff where the expectation is that the return value should not
> get interpreted.
So how can i achieve what i want?
Which is, in pseudocode:
newStaffContext =
#(define-scheme-function (parser location name)(string?)
#{
\layout {
\context {
\Staff
\name #(concat name "Staff")
\alias "Staff"
instrumentName = #name
}
}
#})
\newStaffContext "Test"
\newStaffContext "Foo"
etc... (i hope it's clear what i want)
thanks,
Janek
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user