- if (val != SCM_UNDEFINED)
- {
- SCM prev = internal_get_property (prop);
-
- if (gh_pair_p (prev) || prev == SCM_EOL)
- {
- bool ok = type_check_assignment (eltprop, val, ly_symbol2scm ("backend-type?"));
-
- if (ok)
- {
- prev = gh_cons (gh_cons (eltprop, val), prev);
- internal_set_property (prop, prev);
- }
- }
- else
- {
- // warning here.
- }
-
- }
+ SCM definition = scm_car (s);
+ bool is_scheme = false;
+
+ Translator *type = 0;
+ if (ly_is_symbol (definition))
+ type = get_translator (definition);
+ else if (ly_is_pair (definition))
+ {
+ type = get_translator (ly_symbol2scm ("Scheme_engraver"));
+ is_scheme = true;
+ }
+ 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.
+ definition = scm_call_1 (definition, cs);
+ type = get_translator (ly_symbol2scm ("Scheme_engraver"));
+ is_scheme = true;
+ }
+
+ if (!type)
+ warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));