Each piece of advice has a flag that says whether it is enabled or
not. By enabling or disabling a piece of advice, you can turn it on
and off without having to undefine and redefine it. For example, here is
how to disable a particular piece of advice named my-advice
for
the function foo
:
(ad-disable-advice 'foo 'before 'my-advice)
This function by itself only changes the enable flag for a piece of
advice. To make the change take effect in the advised definition, you
must activate the advice for foo
again:
(ad-activate 'foo)
You can also disable many pieces of advice at once, for various functions, using a regular expression. As always, the changes take real effect only when you next reactivate advice for the functions in question.
Go to the first, previous, next, last section, table of contents.