mred:add-prefererence-callback adds a callback which is called with a symbol naming a preference and it's value, when the preference changes. If the callback function returns #f, the preference is not changed. mred:add-preference-callback returns a thunk, which when invoked, removes the callback from this preference.
The callbacks will be called in the order in which they were added.
If you are adding a callback for a preference that requires marshalling and unmarshalling, you must set the marshalling and unmarshalling functions by calling mred:set-preference-un/marshall before adding a callback.
This function raises mred:exn:unknown-preference if the preference has not been set.