[EMAIL PROTECTED] wrote:
Roman Stawski <[EMAIL PROTECTED]> writes:
Take a look at http://lsr.dsi.unimi.it/LSR/Item?u=1&id=493
Nice!
Is there a way to get rid of the "warning: no such internal option:
target"?
I asked Nicolas Sceaux the same question when he helped me set this up.
Apparently, the internal options are hard-coded and the warning is
displayed before the scheme code is executed. :-(
This lets you have constructs such as
\ifTargetIn #'(foo) {
...
}
A limitation is that it works on music expressions, while I would like
such a function to operate on (a series of) input lines.
Similar to
\ifTargetIn #'(foo) \include "somelines.ly"
but then with the contents of somelines.ly included, e.g.,
\ifTargetIn #'(foo) \do
... arbitrary lines of lilypond code ...
\done
Agreed.
My original solution was to use a perl pre-processor that stripped out
unwanted code. This made debugging much more difficult since the lilypond
parser dosn't see the same thing as in the source code (different line
numbers and unexpected side-effects).
I've come across four cases using the 'ifTarget' solution
1. Musical expressions work fine (when used with grouping like <<...>> and
{...}
2. Scheme snippets and markup blocks for which there are #if-target-in
equivalents
3. Layout, paper and other context configuration can usually be handled by
scheme snippets, though some acrobatics may be necessary.
4. Top-level constructs (\include, \score, variable definitions) for which
I haven't been able to find a solution. On other hand, this hasn't raised
too many problems since the /contents/ of these constructs can always be
protected by the macros. The downside is that I need to live with warnings
such as "warning: no music found in score"
If you have any ideas on how to improve it, let me know
Roman
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user