]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-group.cc
* Unify fetaDynamic and fetaNumber into one fetaText encoding
[lilypond.git] / lily / translator-group.cc
index 8100a4de17592ce660ffa8d45a8635112a81ef55..dc2b772428f681e935d6e089f7fbffe16610bb87 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -167,6 +167,16 @@ Translator_group::create_child_translator (SCM sev)
          instance = type->clone ();
          dynamic_cast<Scheme_engraver*> (instance)->init_from_scheme (definition);
        }
+      else if (ly_is_procedure (definition))
+       {
+         // `definition' is a procedure, which takes the context as
+         // an argument and evaluates to an a-list scheme engraver
+         // definition.
+         SCM def = scm_call_1 (definition, cs);
+         type = get_translator (ly_symbol2scm ("Scheme_engraver"));
+         instance = type->clone ();
+         dynamic_cast<Scheme_engraver*> (instance)->init_from_scheme (def);
+       }
         
       if (!type)
        warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));