From d7e9ab2f2782383025ffacd93a306f61f3ef7d45 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Thu, 12 Sep 2013 22:05:07 +0200 Subject: [PATCH] Issue 3553/2: When creating a hierarchy above Bottom, all intermediate levels are named "\new" Previously, get_default_interpreter gave all intermediate levels the same id as that of the new Bottom level. However, since issue 3225, there can be more than one Bottom in one hierarchy since a Bottom context (defined by not having a \defaultchild) can still have children contexts (of any type it \accepts even while it would not create them implicitly). So it is a bad idea to give implicitly created contexts the same id as any explicitly named context. --- lily/context.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lily/context.cc b/lily/context.cc index c72e9eeb25..491ea8f0d8 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -425,9 +425,12 @@ Context::get_default_interpreter (const string &context_id) warning (_f ("cannot find or create: `%s'", name.c_str ())); t = unsmob_context_def (this->definition_); } - - Context *tg = create_context (t, context_id, SCM_EOL); - return tg->get_default_interpreter (context_id); + if (scm_is_symbol (t->get_default_child (SCM_EOL))) + { + Context *tg = create_context (t, "\\new", SCM_EOL); + return tg->get_default_interpreter (context_id); + } + return create_context (t, context_id, SCM_EOL); } else if (!context_id.empty () && context_id != id_string ()) { -- 2.39.5