+#include "simple-closure.hh"
+#include "warn.hh"
+
+#ifndef NDEBUG
+static SCM modification_callback = SCM_EOL;
+
+LY_DEFINE (ly_set_grob_modification_callback, "ly:set-grob-modification-callback",
+ 1, 0, 0, (SCM cb),
+ "Specify a procedure that will be called every time lilypond modifies "
+ "a grob property. The callback will receive as arguments "
+ "the grob that is being modified, the name of the C++ file in which "
+ "the modification was requested, the line number in the C++ file in "
+ "which the modification was requested, the property to be changed and "
+ "the new value for the property.")
+{
+
+ SCM_ASSERT_TYPE(ly_is_procedure (cb), cb, SCM_ARG1, __FUNCTION__,
+ "procedure");
+
+ modification_callback = cb;
+ return SCM_UNSPECIFIED;
+}
+#endif