+/*
+ Print a vertical line and the rank number, to aid debugging.
+ */
+
+MAKE_SCHEME_CALLBACK(Paper_column,print,1);
+SCM
+Paper_column::print (SCM p)
+{
+ Grob *me = unsmob_grob (p);
+
+ String r = to_string (Paper_column::get_rank (me));
+ SCM properties = Font_interface::font_alist_chain (me);
+
+ SCM scm_mol = Text_item::interpret_markup (me->get_paper ()->self_scm (),
+ properties,
+ scm_makfrom0str (r.to_str0 ()));
+ Stencil t = *unsmob_stencil (scm_mol);
+ t.align_to (X_AXIS, CENTER);
+ t.align_to (Y_AXIS, DOWN);
+
+ Stencil l = Lookup::filled_box (Box (Interval (-0.01, 0.01),
+ Interval (-2, -1)));
+
+ t.add_stencil (l);
+ return t.smobbed_copy ();
+}
+
+/*
+ This is all too hairy. We use bounded-by-me to make sure that some
+ columns are kept "alive". Unfortunately, when spanners are suicided,
+ this falls apart again. (sigh.)
+
+ THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER.
+ */
+MAKE_SCHEME_CALLBACK(Paper_column,before_line_breaking,1);
+SCM
+Paper_column::before_line_breaking (SCM grob)
+{
+ Grob *me = unsmob_grob (grob);
+
+ SCM c = me->get_grob_property ("bounded-by-me");
+ SCM *ptrptr = &c;
+
+ while (gh_pair_p (*ptrptr))
+ {
+ Grob * g = unsmob_grob (gh_car (*ptrptr));
+
+ if (!g || !g->live ())
+ {
+ *ptrptr = gh_cdr (*ptrptr);
+ }
+ else
+ {
+ ptrptr = SCM_CDRLOC (*ptrptr);
+ }
+ }
+
+ me->set_grob_property ("bounded-by-me", c);
+ return SCM_UNSPECIFIED;
+}