Small library for adding and removing advice to functions.
Using use-package with quelpa.
(use-package
:quelpa ((advice-tools
:fetcher github
:repo "lordpretzel/advice-tools")
:upgrade t)
)
Using use-package with straight.el
(use-package advice-tools
:straight (advice-tools :type git :host github :repo "lordpretzel/advice-tools"))
Alternatively, install from source. First, clone the source code:
cd MY-PATH
git clone https://github.com/lordpretzel/advice-tools.git
Now, from Emacs execute:
M-x package-install-file RET MY-PATH/advice-tools
Alternatively to the second step, add this to your .emacs
file:
(add-to-list 'load-path "MY-PATH/advice-tools")
(require 'advice-tools)
Adds the following functions:
advice-tools/advice-add-if-def
- Add adviceTHEADVICE
as typeT
to functionf
if the function to be advised and the advising function both exists.advice-tools/advice-unadvice
- Remove all advices from symbolSYM
.advice-tools/advice-remove-if-def
- Add advice if the function to be advised and the advising function both exists.