]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3553/2: When creating a hierarchy above Bottom, all intermediate levels are...
authorDavid Kastrup <dak@gnu.org>
Thu, 12 Sep 2013 20:05:07 +0000 (22:05 +0200)
committerDavid Kastrup <dak@gnu.org>
Fri, 20 Sep 2013 15:23:26 +0000 (17:23 +0200)
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

index c72e9eeb25e901f250e4708c04c707542fc4ecb1..491ea8f0d864e4ffc0cbe729f5b0e0d4d8f25b12 100644 (file)
@@ -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 ())
     {