lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "include" music-function


From: David Kastrup
Subject: Re: "include" music-function
Date: Thu, 05 Jan 2012 13:50:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Jan-Peter Voigt <address@hidden> writes:

> 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 #{ #}.

Ah yes.  ly:parse-file does not help either?

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]