lilypond-user
[Top][All Lists]
Advanced

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

Re: Where/when does LilyPond handle #(ly:set-option) commands?


From: Urs Liska
Subject: Re: Where/when does LilyPond handle #(ly:set-option) commands?
Date: Sun, 22 Sep 2013 21:55:52 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

No idea anybody?

Am 20.09.2013 11:08, schrieb Urs Liska:
Hi,

I would like LilyPond to insert a style file depending on the presence of a command line switch.

Inserting the following into "init.ly"

#(if (ly:get-option 'draft-mode)

     (ly:parser-include-string parser "\\include \"draft-mode.ily\""))


works when I add the option to the command line

lilypond -ddraft-mode file.ly

However I want to also be able to process options that have been included in the input file.
Concretely the thought "draft-mode.ily" file will itself check for the presence of further command line options.
What I would like to write is a file like

\version "2.17.26"

#(ly:set-option 'draft-color-editorial)

...


and have "draft-mode.ily" check for this option
so that the relevant style sheet will include the relevant style sheet, but only if -ddraft-mode is set.


But it doesn't work, options set in the input file aren't respected.
So obviously LilyPond hasn't parsed the input file when the check is performed from within "init.ly".


So my question is: What would be the appropriate point to insert such a check?
It should already see options set by ly:set-option commands but it should occur before any engraving has started.


Thanks for any hints
Urs





_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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