]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/property-engraver.cc
release: 1.3.106
[lilypond.git] / lily / property-engraver.cc
index 312e1022be9019c9bc9d6019aa8590a2e9cabb97..9861866e82442545206b97bdfc2f00153a1dd147 100644 (file)
@@ -109,43 +109,53 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o
   
       SCM val = get_property (prop_sym);
 
-      if (val == SCM_UNDEFINED)
+      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_elt_property (elt_prop_sym, val);
 
-         String msg = "Property_engraver is deprecated. Use\n \\property "
-           + origin->type_str_
-           + ".basicXXXXProperties"
-           + " \\push #'"
-           + ly_symbol2string (elt_prop_sym)
-           + " = #";
-         warning (msg);
-         scm_display (val, scm_current_error_port ());
+         SCM errport = scm_current_error_port ();
+         scm_display (prop_sym, errport);
+         scm_puts (_(" is deprecated. Use\n \\property ").ch_C(), errport);
+
+         scm_puts (origin->type_str_.ch_C(), errport);
+         scm_puts (".", errport);
+         
+         SCM name = e->get_elt_property ("meta");
+         name = scm_assoc (ly_symbol2scm ("name"), name);
+         scm_display (gh_cdr(name), errport);
+         scm_puts(" \\push #'",errport);
+         scm_write (elt_prop_sym,errport);
+         scm_puts ( " = #",errport);
+         scm_write (val, scm_current_error_port ());
+         scm_puts ("\n", errport);
        }
       else
 
        /*
-           we don't print a warning if VAL == #f, because we would
+           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 = ##f
+           slurDash = #1 [...] slurDash = ()
 
            should not cause "type error: slurDash expects number not
-           boolean"
+           boolean
 
        */
-       if (val != SCM_BOOL_F)
+       if (val != SCM_EOL)
          {                     // not the right type: error message.
            SCM errport = scm_current_error_port ();
            warning (_("Wrong type for property"));
            scm_display (prop_sym, errport);
-           scm_puts (", type predicate: ", errport);
-           scm_display (type_p, errport);
+           scm_puts (", type: ", errport);
+
+           SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL);
+           
+           scm_display (gh_call1 (typefunc, type_p), errport);
            scm_puts (", value found: ", errport);
-           scm_display (val, errport);
+           scm_write (val, errport);
            scm_puts (" type: ", errport);
            scm_display (ly_type (val), errport);
            scm_puts ("\n", errport);