[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wed, 27 Nov 2013 12:19:31 +0400
What the right way to use advices? (I know that best way it to not use it
At my current level of understanding:
1) You declare advices with `defadvice'. (acces arguments of original
function by `ad-get-arg').
(defadvice switch-to-buffer (after my-switch-to-buffer-advice)
(let ((buf (ad-get-arg 0)))
2) Then you call `ad-activate'.
Example: (ad-activate 'switch-to-buffer)
The problem here is that it will activate all advices for that function
that were defined before this `ad-activate' call, not only
3) I'm not sure. You can enable/disable certain advices with
(ad-disable-advice 'switch-to-buffer 'after 'my-switch-to-buffer-advice)
4) `ad-deactivate' will disable all advices for function.
Example: (ad-deactivate 'switch-to-buffer)
Am I right?
- About advices.,
Constantin Kulikov <=