> A little more forward looking: > > In such situations I often get this thought: if the variable was > replaced with a function accepting zero arguments, then we could use > `add-function' and `remove-function' to control the return value of the > "binding". > > I know the advice mechanism has the reputation of only being suitable > for end user customization/hacks, but in cases like this one we could > make the modification of the value more explicit and controllable. > Dealing with interferences would be forced to be taken into account more > directly , and we would get some useful mechanisms like priorities or > looking at the context out of the box. > > We could also invent some even better mechanism, maybe. But in this > case binding variables doesn't look like an optimal approach at least. This mechanism looks like a variable watcher enabled by `add-variable-watcher'. So you could add a watcher that conditionally controls variable modifications.