- final_mom_ = final;
- definition_ = o->find_context_def (ly_symbol2scm ("Global"));
- unsmob_context_def (definition_)->apply_default_property_operations (this);
- accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
+ definition_ = find_context_def (o, ly_symbol2scm ("Global"));
+
+ now_mom_.set_infinite (-1);
+ prev_mom_.set_infinite (-1);
+
+ /* We only need the most basic stuff to bootstrap the context tree */
+ event_source ()->add_listener (GET_LISTENER (Context, create_context_from_event),
+ ly_symbol2scm ("CreateContext"));
+ event_source ()->add_listener (GET_LISTENER (Global_context, prepare),
+ ly_symbol2scm ("Prepare"));
+ events_below ()->register_as_listener (event_source_);
+
+ Context_def *globaldef = unsmob<Context_def> (definition_);
+ if (!globaldef)
+ programming_error ("no `Global' context found");
+ else
+ globaldef->apply_default_property_operations (this);
+
+ default_child_ = ly_symbol2scm ("Score");
+ accepts_list_ = scm_list_1 (default_child_);