GNU-devel ELPA - advice-patch

advice-patch

Description
Use patches to advise the inside of functions
Latest
advice-patch-0.1.0.20201220.233221.tar (.sig), 2024-Mar-31, 10.0 KiB
Maintainer
Stefan Monnier <monnier@iro.umontreal.ca>
Atom feed
advice-patch.xml
Website
https://elpa.gnu.org/packages/advice-patch.html
Browse repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

This package builds on `advice-add' but instead of letting you add code
before/after/around the body of the advised function, it lets you directly
patch the inside of that function.

This is inspired from [el-patch](https://github.com/raxod502/el-patch),
but stripped down to its barest essentials.  `el-patch' provides many more
features, especially to be notified when the advised function is modified
and to help you update your patches accordingly.

Beware: this can eat your lunch and can misbehave unexpectedly in many
legitimate cases.

Use it is as follows:

    (advice-patch 'foo (my new code)
                  [(some old code)
                   (some (other version) (of the old) code))])

This will fetch the source code of `foo', look for an occurrence
of one of the old code chunks listed, replace it with
`(my new code)', compile the result, and finally ask `advice-add' to use it
to override the original definition.

TODO:

- Lots of cases to fix and features to add.  See FIXMEs in the code.

Old versions

advice-patch-0.1.0.20201221.43221.tar.lz2020-Dec-212.69 KiB
advice-patch-0.1.0.20201221.43221.tar.lz2020-Dec-212.69 KiB
advice-patch-0.1.0.20201130.21459.tar.lz2020-Dec-142.56 KiB