- SCM val = get_property (prop_sym, 0);
- if (val != SCM_UNDEFINED
- && gh_apply (type_p, scm_listify (val, SCM_UNDEFINED))
- == SCM_BOOL_T)
- e->set_elt_property (ly_scm2string (elt_prop_name), val);
+ SCM val = get_property (prop_sym);
+
+ if (val == SCM_EOL)
+ ; // Not defined in context.
+ else if (gh_apply (type_p, scm_listify (val, SCM_UNDEFINED))
+ == SCM_BOOL_T) // defined and right type: do it
+ {
+ e->set_grob_property (elt_prop_sym, val);
+
+ SCM meta = e->get_grob_property ("meta");
+ SCM name = scm_assoc (ly_symbol2scm ("name"), meta);
+ warning (_f ("%s is deprecated. Use\n \\property %s.%s \\override #'%s = #%s",
+ ly_symbol2string (prop_sym).ch_C (),
+ origin->type_str_.ch_C (),
+ ly_scm2string (gh_cdr (name)).ch_C (),
+ ly_symbol2string (elt_prop_sym).ch_C (),
+ ly_scm2string (ly_write2scm (val)).ch_C ()));
+ }
+ else
+
+ /*
+ we don't print a warning if VAL == (), because we would
+ get lots of warnings when we restore stuff to default, eg.
+
+ slurDash = #1 [...] slurDash = ()
+
+ should not cause "type error: slurDash expects number not
+ boolean
+
+ */
+ if (val != SCM_EOL)
+ { // not the right type: error message.
+ SCM errport = scm_current_error_port ();
+ SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL);
+ SCM type_name = gh_call1 (typefunc, type_p);
+ warning (_f ("Wrong type for property: %s, type: %s, value found: %s, type: %s",
+ ly_symbol2string (prop_sym).ch_C (),
+ ly_scm2string (type_name).ch_C (),
+ ly_scm2string (ly_write2scm (val)).ch_C (),
+ ly_scm2string (ly_type (val)).ch_C ()));
+ scm_puts ("\n", errport);
+ }