bug-lilypond
[Top][All Lists]
Advanced

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

Re: Issue 1914 in lilypond: Manual page break in a user defined variable


From: lilypond
Subject: Re: Issue 1914 in lilypond: Manual page break in a user defined variable
Date: Thu, 22 Sep 2011 09:03:23 +0000


Comment #1 on issue 1914 by address@hidden: Manual page break in a user defined variable
http://code.google.com/p/lilypond/issues/detail?id=1914

We don't allow music between scores. Where should it go? If you take a look at ly/music-functions-init.ly, you'll see the comment

%% pageBreak and pageTurn are music functions (iso music indentifiers),
%% because music identifiers are not allowed at top-level.

The error message, however, is startling. How does it come about? Taking a look in lily/parser.yy, we see that \addlyrics occurs as new_lyrics.

That's part of re_rhythmed_music when preceded by closed_music. re_rhythmed_music is one possibility for prefix_composite_music, which is one thing that can occur at top level in the form of composite_music. So we have the rather absurd situation that
MUSIC_IDENTIFIER ADDLYRICS
is a valid toplevel music expression while MUSIC_IDENTIFIER isn't.

While "closed_music" is a contraption of mine, I was employing it without a change in meaning. The original culprit is

commit dfb68d00300d837d723605790d1833b088faee9a
Author: Reinhold Kainhofer <address@hidden>
Date:   Fri Oct 29 16:21:46 2010 +0200

    Allow music identifiers in \addlyrics (no need for braces any more)

    In particular, so far the following did not work:
        \new Staff { \m \addlyrics \l }
    Instead, one had to use braces around \m and \l:
        \new Staff { {\m} \addlyrics {\l} }

    This patch extends the parser to allow music identifiers,
    so that no braces are needed any more.

So with this change, all the original reporter needs to do, is write
\myPageBreak \addlyrics {}
and voila, things work out.

This is stupid enough that I suggest that Reinhold's patch (and my equivalent recasting of it) make sense only when we also allow MUSIC_IDENTIFIER as a top expression in which case the special-casing of \pageBreak will no longer be necessary.

Anybody know a reason this could cause problems?




reply via email to

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