diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-26 16:39:41 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-26 17:36:13 -0400 |
commit | f30625943edefbd88ebf84acbc254ed88db27beb (patch) | |
tree | 6bbf46ff01195583b8f5aac5e51584075171747a /lisp/emacs-lisp/cl-print.el | |
parent | bc9be5449e1127bc1b05a6cad8471c6eba52c8e9 (diff) | |
download | emacs-f30625943edefbd88ebf84acbc254ed88db27beb.tar.gz emacs-f30625943edefbd88ebf84acbc254ed88db27beb.tar.bz2 emacs-f30625943edefbd88ebf84acbc254ed88db27beb.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp/cl-print.el')
-rw-r--r-- | lisp/emacs-lisp/cl-print.el | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 457ef506bc6..30d7e6525a4 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -221,27 +221,6 @@ into a button whose action shows the function's disassembly.") 'byte-code-function object))))) (princ ")" stream)) -;; This belongs in nadvice.el, of course, but some load-ordering issues make it -;; complicated: cl-generic uses macros from cl-macs and cl-macs uses advice-add -;; from nadvice, so nadvice needs to be loaded before cl-generic and hence -;; can't use cl-defmethod. -(cl-defmethod cl-print-object :extra "nadvice" - ((object compiled-function) stream) - (if (not (advice--p object)) - (cl-call-next-method) - (princ "#f(advice-wrapper " stream) - (when (fboundp 'advice--how) - (princ (advice--how object) stream) - (princ " " stream)) - (cl-print-object (advice--cdr object) stream) - (princ " " stream) - (cl-print-object (advice--car object) stream) - (let ((props (advice--props object))) - (when props - (princ " " stream) - (cl-print-object props stream))) - (princ ")" stream))) - ;; This belongs in oclosure.el, of course, but some load-ordering issues make it ;; complicated. (cl-defmethod cl-print-object ((object accessor) stream) |