From 32f47bdec7c2008ebff80d68463d022946db5df2 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Mon, 8 Sep 2014 11:15:19 +0200 Subject: [PATCH] Fix bugs preventing \addlyrics from finding an existing context to attach to --- lily/parser.yy | 6 +++--- scm/ly-syntax-constructors.scm | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lily/parser.yy b/lily/parser.yy index b41aff64c8..645b35b6ee 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1454,6 +1454,9 @@ basic_music: music_function_call | repeated_music | music_bare + | LYRICSTO simple_string lyric_mode_music { + $$ = MAKE_SYNTAX ("lyric-combine", @$, $2, $3); + } ; contextable_music: @@ -1487,9 +1490,6 @@ composite_music: { $$ = MAKE_SYNTAX ("add-lyrics", @$, $1, scm_reverse_x ($2, SCM_EOL)); } %prec COMPOSITE - | LYRICSTO simple_string lyric_mode_music { - $$ = MAKE_SYNTAX ("lyric-combine", @$, $2, $3); - } ; music_bare: diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm index 73e871686e..7741914b0f 100644 --- a/scm/ly-syntax-constructors.scm +++ b/scm/ly-syntax-constructors.scm @@ -207,11 +207,10 @@ into a @code{MultiMeasureTextEvent}." 'context-type ctx 'origin location))) -;; TODO: It seems that this function rarely returns anything useful. (define (get-first-context-id type mus) "Find the name of a ContextSpeccedMusic with given type" (let ((id (ly:music-property mus 'context-id))) - (if (and (eq? (ly:music-property mus 'type) 'ContextSpeccedMusic) + (if (and (eq? (ly:music-property mus 'name) 'ContextSpeccedMusic) (eq? (ly:music-property mus 'context-type) type) (string? id) (not (string-null? id))) @@ -246,7 +245,7 @@ into a @code{MultiMeasureTextEvent}." existing-voice-name (get-next-unique-voice-name))) (voice (if (string? existing-voice-name) - (music) + music (make-music 'ContextSpeccedMusic 'element music 'context-type 'Voice -- 2.39.2