1\version "2.19.80"
2
3\header {
4  texidoc = "@code{\\context} finds the current context by type and ID
5even when there are matching contexts both above and below.
6@verbatim
7    StaffGroup A
8       \
9      StaffGroup A (from here, find StaffGroup A)
10         \
11        StaffGroup A
12@end verbatim
13INNER and RESULT should appear in the left margin."
14}
15
16\new StaffGroup = "A" <<
17  \new StaffGroup = "A" \with { instrumentName = "SOUGHT" } <<
18    \new StaffGroup = "A" \with { instrumentName = "INNER" } <<
19      s1
20    >>
21    \context StaffGroup = "A" <<
22      %% This name is expected to replace SOUGHT.
23      \set StaffGroup.instrumentName = "RESULT"
24      s1
25    >>
26  >>
27>>
28