]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix bugs preventing \addlyrics from finding an existing context to attach to
authorDavid Kastrup <dak@gnu.org>
Mon, 8 Sep 2014 09:15:19 +0000 (11:15 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 14 Sep 2014 05:44:55 +0000 (07:44 +0200)
lily/parser.yy
scm/ly-syntax-constructors.scm

index b41aff64c893cb455105758c65d5a6e6ca797977..645b35b6ee04147cbd31a545638ea5bcd8c93b9a 100644 (file)
@@ -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:
index 73e871686e3ee079f488ec646b0d550d870206ba..7741914b0f8fa50125ec2d5275c97224c4b62287 100644 (file)
@@ -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