- if (!ly_is_procedure (cb))
- warning (_ ("not setting modification callback: not a procedure"));
- else
- modification_callback = cb;
- return SCM_EOL;
+ modification_callback = (ly_is_procedure (cb)) ? cb : SCM_BOOL_F;
+ return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_set_property_cache_callback, "ly:set-property-cache-callback",
+ 1, 0, 0, (SCM cb),
+ "Specify a procedure that will be called whenever lilypond"
+ " calculates a callback function and caches the result. The"
+ " callback will receive as arguments the grob whose property it"
+ " is, the name of the property, the name of the callback that"
+ " calculated the property, and the new (cached) value of the"
+ " property.")
+{
+ cache_callback = (ly_is_procedure (cb)) ? cb : SCM_BOOL_F;
+ return SCM_UNSPECIFIED;