From: Neil Puttock Date: Tue, 21 Apr 2009 22:08:26 +0000 (+0100) Subject: Fix #655. X-Git-Tag: release/2.12.3-1~130 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f073e985d3aeafd05d1eef91dcd485fa589f1d8f;p=lilypond.git Fix #655. - check that an engraver exists before an attempt is made to remove it within a \with block - use warning () instead of error () so that compilation can continue even when an unknown translator is detected (cherry picked from commit 4d193df8196c33871ceb48756c55edd1b1079fbd) --- diff --git a/lily/context-def.cc b/lily/context-def.cc index 0b95a8b952..31b821655c 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -123,12 +123,11 @@ Context_def::add_context_mod (SCM mod) if (ly_symbol2scm ("default-child") == tag) default_child_ = sym; else if (ly_symbol2scm ("consists") == tag - || ly_symbol2scm ("consists-end") == tag || ly_symbol2scm ("remove") == tag) { if (!get_translator (sym)) - error (_f ("program has no such type: `%s'", - ly_symbol2string (sym).c_str ())); + warning (_f ("program has no such type: `%s'", + ly_symbol2string (sym).c_str ())); else translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_); } @@ -286,7 +285,8 @@ Context_def::get_translator_names (SCM user_mod) const if (ly_symbol2scm ("consists") == tag) l1 = scm_cons (arg, l1); - else if (ly_symbol2scm ("remove") == tag) + else if (ly_symbol2scm ("remove") == tag + && get_translator (arg)) l1 = scm_delete_x (arg, l1); } diff --git a/lily/translator-ctors.cc b/lily/translator-ctors.cc index 5290743e2e..ab1a7db144 100644 --- a/lily/translator-ctors.cc +++ b/lily/translator-ctors.cc @@ -50,7 +50,10 @@ get_translator (SCM sym) global_translator_dict->try_retrieve (sym, &v); if (v == SCM_BOOL_F) - error (_f ("unknown translator: `%s'", ly_symbol2string (sym).c_str ())); + { + warning (_f ("unknown translator: `%s'", ly_symbol2string (sym).c_str ())); + return 0; + } return unsmob_translator (v); }