[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-bug
Subject:    Re: \context + \set ineffective
From:       Dan Eble <dan () faithful ! be>
Date:       2018-04-16 14:04:03
Message-ID: D71870C4-4482-4D73-B7AD-99085AD301F4 () faithful ! be
[Download RAW message or body]

I've convinced myself that this is a bug, so I will spend some time trying to change it and see what happens.  I will probably use something like the following as regression tests.

Regards,
— 
Dan

\version "2.19.80"

\layout {
  indent = 0
  line-width = 2 \cm
}

%% Find the nearest enclosing context of some type.
\score {
  \new StaffGroup = "A" <<
    \new StaffGroup = "B" \with { shortInstrumentName = "FAIL" } {
      e'1
      \context StaffGroup {
        %% This is expected to replace FAIL.
        \set StaffGroup.shortInstrumentName = "PASS"
      }
      \break
      e'1
    }
  >>
}

%% Find the nearest enclosing context by type and ID.
\score {
  \new StaffGroup = "A" <<
    \new StaffGroup = "B" \with { shortInstrumentName = "FAIL" } {
      e'1
      \context StaffGroup = "B" {
        %% This is expected to replace FAIL.
        \set StaffGroup.shortInstrumentName = "PASS"
      }
      \break
      e'1
    }
  >>
}

% Create a new context by type and ID even though both match the
% enclosing context.
\score {
  \new StaffGroup = "A" <<
    \new StaffGroup = "B" \with { shortInstrumentName = "PASS" } {
      g'1
      \new StaffGroup = "B" {
        %% This does not replace PASS because it is a new context, and
        %% it is not engraved because this context contains no music.
        \set StaffGroup.shortInstrumentName = "FAIL"
      }
      \break
      g'1
    }
  >>
}

% Find an enclosing context by type and ID when there is another
% context of the same type in between.
\score {
  \new StaffGroup = "A" \with { shortInstrumentName = "FAIL" } <<
    \new StaffGroup = "B" {
      b'1
      \context StaffGroup = "A" {
        %% This is expected to replace FAIL.
        \set StaffGroup.shortInstrumentName = "PASS"
      }
      \break
      b'1
    }
  >>
}


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic