Jan-Peter Voigt <jp.vo...@gmx.de> writes: > I am compiling this file directly: > --snip-- > #(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)) > (let ((content (ly:gulp-file file))) > (ly:parser-include-string parser content))) > (make-music 'SequentialMusic 'void #t)))) > > \includeLocal "test.ly" > --snip-- > This function first compares the outname with the location name and > only includes the file if they match. (This should not work, if you > have set some output-suffix!) > > This is a usable solution to me. But I would like to have the correct > location info available, while parsing the included file. > Is it possible to create an arbitrary "include"-music-function? This > would make it possible, to (for example) include all files in a > directory or matching a specific pattern.
Any reason you don't just do #{ \include #file #} here? -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel