]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #655.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 21 Apr 2009 22:08:26 +0000 (23:08 +0100)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 17 Jul 2009 08:12:39 +0000 (01:12 -0700)
- 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)

lily/context-def.cc
lily/translator-ctors.cc

index 0b95a8b952e487178621abc61ecd402c23aacecb..31b821655c3074958fd907e97d56a41743c98081 100644 (file)
@@ -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);
     }
 
index 5290743e2e3c29536303bfd1daa7ec0d2f9665bc..ab1a7db144faf370a56b45bacd1549b1354ea2e6 100644 (file)
@@ -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);
 }