What about this case where the slur is only on the very last note of
the first ending?
%%% BEGIN EXAMPLE %%%
\version "2.24.4"
\fixed c'' {
r2 r4 g,(
\repeat volta 2 {
\mark \default
c4) r d4 r |
\alternative {
\volta 1 { e2. g,4 } % I want this G to slur back to the C at
letter A
\volta 2 { c1 }
}
}
}
%%% END EXAMPLE %%%
If I use the empty chord trick \volta 1 { e2. g,4( <>) } then it slurs
to the second ending, which I don't want.
It's not a great solution, but use a \laissezVibrer slur on the G, then use \shape to move it up and invert it:
\volta 1 { e2. g,4\laissezVibrer } % Needs \shape (difficult)