From d756b5523a8d82491f734d79943314c5e6cd35b4 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Thu, 12 Sep 2013 19:25:17 +0200 Subject: [PATCH] Issue 3553/1: get_default_interpreter should create contexts with missing context_id At the current point of time, an existing bottom context is returned even when there is a mismatch in ids. For example, when writing \context Voice = "one" << { \voiceOne g' g' g' g' } \context Voice = "two" { \voiceTwo c' c' c' c' } >> creates two voices, while \context Bottom = "one" << { \voiceOne g' g' g' g' } \context Bottom = "two" { \voiceTwo c' c' c' c' } >> only uses a single Voice called "one". This is arguably wrong. --- lily/context.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lily/context.cc b/lily/context.cc index 8d44ca8f85..c72e9eeb25 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -429,6 +429,13 @@ Context::get_default_interpreter (const string &context_id) Context *tg = create_context (t, context_id, SCM_EOL); return tg->get_default_interpreter (context_id); } + else if (!context_id.empty () && context_id != id_string ()) + { + if (daddy_context_ && !dynamic_cast (daddy_context_)) + return daddy_context_->get_default_interpreter (context_id); + warning (_f ("cannot find or create new Bottom = \"%s\"", + context_id.c_str ())); + } return this; } -- 2.39.5