+
+/**
+ Do break substitution, and return new value.
+ */
+SCM
+Score_element::handle_broken_smobs (SCM s, Line_of_score * line)
+{
+ if (SMOB_IS_TYPE_B (Score_element, s))
+ {
+ Score_element *sc = SMOB_TO_TYPE (Score_element, s);
+ Score_element * br =0;
+ if (sc->line_l () != line)
+ {
+ br = sc->find_broken_piece (line);
+ }
+
+ if (br)
+ return br->self_scm_;
+ }
+ else if (gh_pair_p (s))
+ {
+ /*
+ UGH! breaks on circular lists.
+ */
+ gh_set_car_x (s, handle_broken_smobs (gh_car (s), line));
+ gh_set_cdr_x (s, handle_broken_smobs (gh_cdr (s), line));
+ }
+ return s;
+}
+