+Spanner::broken_b () const
+{
+ return broken_into_l_arr_.size ();
+}
+
+
+/*
+ If this is a broken spanner, return the amount the left end is to be
+ shifted horizontally so that the spanner starts after the initial
+ clef and key on the staves. This is necessary for ties, slurs,
+ crescendo and decrescendo signs, for example.
+*/
+Real
+Spanner::get_broken_left_end_align () const
+{
+ Paper_column *sc = dynamic_cast<Paper_column*> (spanned_drul_[LEFT]->column_l ());
+
+ // Relevant only if left span point is first column in line
+ if (sc != NULL &&
+ sc->break_status_dir () == RIGHT)
+ {
+ /*
+
+ We used to do a full search for the Break_align_item.
+ But that doesn't make a difference, since the Paper_column
+ is likely to contain only a Break_align_item.
+ */
+ return sc->extent (sc, X_AXIS)[RIGHT];
+ }
+
+ return 0.0;
+}
+
+SCM
+Spanner::do_derived_mark ()
+{
+ /*
+ We'd be fucked if this is called before spanned_drul_[] is inited. */
+ if (status_c_ == ORPHAN)
+ return SCM_EOL;
+
+ Direction d = LEFT;
+ do
+ if (spanned_drul_[d])
+ scm_gc_mark (spanned_drul_[d]->self_scm ());
+ while (flip (&d) != LEFT);
+
+ for (int i= broken_into_l_arr_.size () ; i--;)
+ scm_gc_mark (broken_into_l_arr_[i]->self_scm ());
+
+ return SCM_EOL;
+}
+
+
+/*
+ Set left or right bound to IT.
+
+ Warning: caller should ensure that subsequent calls put in ITems
+ that are left-to-right ordered.
+ */
+void
+add_bound_item (Spanner* sp, Grob*it)
+{
+ if (!sp->get_bound (LEFT))
+ sp->set_bound (LEFT, it);
+ else
+ sp->set_bound (RIGHT, it);
+}
+
+/*
+ Extends EXTREMAL_PAIR to include IT
+ */
+static void
+extend_spanner_over_item (Item *it, SCM extremal_pair)
+{
+ if (!it)
+ return;
+ Item * col = it->column_l ();
+ Item * i1 = dynamic_cast<Item*> (unsmob_grob (ly_car (extremal_pair)));
+ Item * i2 = dynamic_cast<Item*> (unsmob_grob (ly_cdr (extremal_pair)));
+ int r = Paper_column::rank_i (col);
+ if (!i1 || r < Paper_column::rank_i (i1->column_l ()))
+ {
+ gh_set_car_x (extremal_pair, it->self_scm ());
+ }
+ if (!i2 || r > Paper_column::rank_i (i2->column_l ()))
+ {
+ gh_set_cdr_x (extremal_pair, it->self_scm ());
+ }
+}
+
+/*
+ Extends EXTREMAL_PAIR to include every grob in VALUE
+ */
+static void
+extend_spanner_over_elements (SCM value, SCM extremal_pair)