]> git.eshelyaron.com Git - emacs.git/commit
nadvice.el: Use OClosures
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 26 Apr 2022 20:39:41 +0000 (16:39 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 26 Apr 2022 21:36:13 +0000 (17:36 -0400)
commitf30625943edefbd88ebf84acbc254ed88db27beb
tree6bbf46ff01195583b8f5aac5e51584075171747a
parentbc9be5449e1127bc1b05a6cad8471c6eba52c8e9
nadvice.el: Use OClosures

* lisp/emacs-lisp/nadvice.el (advice): New OClosure type.
(advice--how-alist): Make it hold prototype OClosures rather
than bytecode strings.
(advice--bytecodes): Delete var.
(advice--where): Make it an obsolete alias of new `advice--how`.
(oclosure-interactive-form, cl-print-object) <advice>: New methods.
(advice--make-1): Delete function.
(advice--make): Use `advice-copy` and `advice-cons`.
(advice--tweak): Use `advice-cons`.
(add-function, advice-add): Rename `where` arg to `how`.

* lisp/emacs-lisp/cl-print.el (cl-print-object) <:extra "nadvice">:
Remove now-redundant ad-hoc method.

* test/lisp/emacs-lisp/nadvice-tests.el (advice-test-print): New test.
lisp/emacs-lisp/cl-print.el
lisp/emacs-lisp/nadvice.el
test/lisp/emacs-lisp/nadvice-tests.el