]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/hara-kiri-group-spanner.cc
* Documentation/user/refman.itely (Automatic note splitting):
[lilypond.git] / lily / hara-kiri-group-spanner.cc
index 8a3f6d05582cdfed8828410a322f058f4743636b..8fdcc19bc86c2947a5b1d227be4196c34d5f857e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1998--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c)  1998--2003 Jan Nieuwenhuizen <janneke@gnu.org>
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -30,10 +30,17 @@ Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
 void
 Hara_kiri_group_spanner::consider_suicide (Grob*me)
 {
+  Spanner*sp = dynamic_cast<Spanner*> (me);
   SCM worth = me->get_grob_property ("items-worth-living");
   if (gh_pair_p (worth))
     return ;
 
+  if (!to_boolean (me->get_grob_property ("remove-first"))
+      && broken_spanner_index (sp) == 0)
+    {
+      return ;
+    }
+  
   Link_array<Grob> childs = Axis_group_interface::get_children (me);
   for (int i = 0; i < childs.size (); i++)
     childs[i]->suicide ();
@@ -94,9 +101,9 @@ Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n)
 
 
 ADD_INTERFACE (Hara_kiri_group_spanner,"hara-kiri-group-interface",
-  "  As Vertical_group_spanner, but keep track of interesting items.  If
-we don't contain any interesting items after linebreaking, then
-gracefully commit suicide.  Objective: don't disgrace Lily by
-typesetting empty lines in orchestral scores.",
-  "items-worth-living");
+  "  As Vertical_group_spanner, but keep track of interesting items.  If       \
+we don't contain any interesting items after linebreaking, then                        \
+gracefully commit suicide.  Objective: don't disgrace Lily by                  \
+typesetting empty lines in orchestral scores.",                                        \
+  "items-worth-living remove-first");