+ if (Item::breakable_b (cols->elem(i)) || Paper_column::musical_b (cols->elem (i)))
+ {
+ newcols.push (cols->elem(i));
+ continue;
+ }
+
+ Grob *c = cols->elem(i);
+ if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
+ {
+ SCM lns = c->get_grob_property ("left-neighbors");
+ lns = gh_pair_p (lns) ? gh_car (lns) : SCM_BOOL_F;
+
+ SCM rns = c->get_grob_property ("right-neighbors");
+ rns = gh_pair_p (rns) ? gh_car (rns) : SCM_BOOL_F;
+
+ /*
+ Either object can be non existent, if the score ends
+ prematurely.
+ */
+ rns = gh_car (unsmob_grob (rns)->get_grob_property ("right-items"));
+ c->set_grob_property ("between-cols", gh_cons (lns,
+ rns));
+
+ /*
+ Set distance constraints for loose columns
+ */
+ Drul_array<Grob*> next_door;
+ next_door[LEFT] =cols->elem (i - 1);
+ next_door[RIGHT] =cols->elem (i + 1);
+ Direction d = LEFT;
+ Drul_array<Real> dists(0,0);
+
+ do
+ {
+ dists[d] = 0.0;
+ Item *lc = dynamic_cast<Item*> ((d == LEFT) ? next_door[LEFT] : c);
+ Item *rc = dynamic_cast<Item*> (d == LEFT ? c : next_door[RIGHT]);
+
+ for (SCM s = lc->get_grob_property ("spacing-wishes");
+ gh_pair_p (s); s = gh_cdr (s))
+ {
+ Grob *sp = unsmob_grob (gh_car (s));
+ if (Note_spacing::left_column (sp) != lc
+ || Note_spacing::right_column (sp) != rc)
+ continue;
+
+ Real space, fixed;
+ fixed = 0.0;
+ bool dummy;
+
+ if (d == LEFT)
+ {
+ /*
+ The note spacing should be taken from the musical
+ columns.
+
+ */
+ Real base = note_spacing (me, lc, rc, shortest, &dummy);
+ Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed);
+
+ space -= increment;
+
+ dists[d] = dists[d] >? space;
+ }
+ else
+ {
+ Real space, fixed_space;
+ Staff_spacing::get_spacing_params (sp,
+ &space, &fixed_space);
+
+ dists[d] = dists[d] >? fixed_space;
+ }
+
+ }
+ }
+ while (flip (&d) != LEFT);
+
+ Rod r;
+ r.distance_f_ = dists[LEFT] + dists[RIGHT];
+ r.item_l_drul_[LEFT] = dynamic_cast<Item*> (cols->elem(i-1));
+ r.item_l_drul_[RIGHT] = dynamic_cast<Item*> (cols->elem (i+1));
+
+ r.add_to_cols ();
+ }
+ else