Since \addlyrics always creates a new Lyrics context, there seems to be
little point in not allowing it to have a \with clause.
This change allows the use of the syntax
\new Voice {...} \addlyrics \with ... {...}
in order to achieve the effect of what previously required
<< \new Voice = "name" {...}
\new Lyrics \with ... \lyricsto "name" {...}
>>
- ADDLYRICS lyric_mode_music {
- $$ = scm_list_1 ($2);
- }
- | new_lyrics ADDLYRICS lyric_mode_music {
- $$ = scm_cons ($3, $1);
+ ADDLYRICS optional_context_mod lyric_mode_music {
+ Context_mod *ctxmod = unsmob<Context_mod> ($2);
+ SCM mods = SCM_EOL;
+ if (ctxmod)
+ mods = ctxmod->get_mods ();
+ $$ = scm_acons ($3, mods, SCM_EOL);
+ }
+ | new_lyrics ADDLYRICS optional_context_mod lyric_mode_music {
+ Context_mod *ctxmod = unsmob<Context_mod> ($3);
+ SCM mods = SCM_EOL;
+ if (ctxmod)
+ mods = ctxmod->get_mods ();
+ $$ = scm_acons ($4, mods, $1);
'origin (ly:music-property music 'origin))))
(voice-type (ly:music-property voice 'context-type))
(lyricstos (map
'origin (ly:music-property music 'origin))))
(voice-type (ly:music-property voice 'context-type))
(lyricstos (map
- (ly:music-property mus 'origin)
+ (ly:music-property (car mus+mods) 'origin)
(ly:set-origin! (make-music 'ContextSpeccedMusic
'create-new #t
'context-type 'Lyrics
(ly:set-origin! (make-music 'ContextSpeccedMusic
'create-new #t
'context-type 'Lyrics
+ 'property-operations (cdr mus+mods)
- voice-name voice-type mus)))))
+ voice-name voice-type
+ (car mus+mods))))))
addlyrics-list)))
(make-simultaneous-music (cons voice lyricstos))))
addlyrics-list)))
(make-simultaneous-music (cons voice lyricstos))))