1\version "2.19.80"
2
3\header {
4  texidoc = "@code{\\context} can find the parent context by type and ID.
5@verbatim
6    StaffGroup A
7       \
8      StaffGroup B (from here, find StaffGroup A)
9@end verbatim
10CHILD and RESULT should appear in the left margin."
11}
12
13\new StaffGroup = "A" \with { instrumentName = "SOUGHT" } <<
14  \new StaffGroup = "B" \with { instrumentName = "CHILD" } <<
15    s1
16    \context StaffGroup = "A" <<
17      %% This name is expected to replace SOUGHT.
18      \set StaffGroup.instrumentName = "RESULT"
19      s1
20    >>
21  >>
22>>
23