Hello David,
Any reason you don't just do #{ \include #file #} here?
yes there is:
--snip--
\version "2.15.21"
#(define-public includeLocal (define-music-function (parser location
file)(string?)
(let ((outname (format "~A.ly" (ly:parser-output-name parser)))
(locname (car (ly:input-file-line-char-column location))))
(if (or (string=? outname locname)(string-suffix? outname
locname))
#{ \include $file #}
(make-music 'SequentialMusic 'void #t)))))
\includeLocal "test.ily"
--snip--
this places the include in some context, generated by #{ #}.
So if I have:
--snip-- ("test.ily")
\version "2.15.21"
mus = \relative c' {
c4 e g c
}
{ \mus }
--snip--
it will fail, because I try to assign "mus" here in a contained context.
Cheers,
Jan-Peter
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel