- {
- programming_error ("busyGrobs invalid");
- continue;
- }
-
- if (end_mom->main_part_ > now.main_part_
- && dynamic_cast<Item *> (g)
- && Note_head::has_interface (g))
- return g;
+ {
+ programming_error ("busyGrobs invalid");
+ continue;
+ }
+
+ // It's a bit irritating that we just have the length and
+ // duration of the Grob.
+ Moment end_from_now =
+ get_event_length (unsmob<Stream_event> (g->get_property ("cause")), now)
+ + now;
+ // We cannot actually include more than a single grace note
+ // using busyGrobs on ungraced lyrics since a grob ending on
+ // grace time will just have disappeared from busyGrobs by the
+ // time our ungraced lyrics appear. At best we may catch a
+ // single grace note.
+ //
+ // However, a single grace note ending on a non-grace time is
+ // indistinguishable from a proper note ending on a non-grace
+ // time. So we really have no way to obey includeGraceNotes
+ // here. Not with this mechanism.
+ if ((*end_mom == end_from_now)
+ && dynamic_cast<Item *> (g)
+ && has_interface<Note_head> (g))
+ {
+ return g;
+ }