+}
+
+/*
+ TODO: look at horizontal-shift to determine ordering between rests
+ for more than two voices.
+*/
+SCM
+Rest_collision::do_shift (Grob *me)
+{
+ SCM elts = me->get_property ("elements");
+
+ Link_array<Grob> rests;
+ Link_array<Grob> notes;
+
+ for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
+ {
+ Grob *e = unsmob_grob (scm_car (s));
+ if (unsmob_grob (e->get_property ("rest")))
+ {
+ /*
+ Ignore rests under beam.
+ */
+ Grob *st = unsmob_grob (e->get_property ("stem"));
+ if (st && unsmob_grob (st->get_property ("beam")))
+ continue;
+
+ rests.push (e);
+ }
+ else
+ notes.push (e);
+ }
+
+ /*
+ handle rest-rest and rest-note collisions
+
+ [todo]
+ * decide not to print rest if too crowded?
+ */
+
+ /*
+ no partners to collide with
+ */
+ if (rests.size () + notes.size () < 2)
+ return SCM_UNSPECIFIED;
+
+ Real staff_space = Staff_symbol_referencer::staff_space (me);
+ /*
+ only rests
+ */
+ if (!notes.size ())