[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/nadvice bc27bdd 3/9: * nadvice/nadvice.el (advice-add):
From: |
Stefan Monnier |
Subject: |
[elpa] externals/nadvice bc27bdd 3/9: * nadvice/nadvice.el (advice-add): Add support for :override |
Date: |
Tue, 1 Dec 2020 16:29:04 -0500 (EST) |
branch: externals/nadvice
commit bc27bdd8e72793d4a4d27add7abaa5b14634c043
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* nadvice/nadvice.el (advice-add): Add support for :override
---
nadvice.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/nadvice.el b/nadvice.el
index a7a8f2a..52bb1d4 100644
--- a/nadvice.el
+++ b/nadvice.el
@@ -27,7 +27,7 @@
;;
;; Limitations;
;; - only supports `advice-add' and `advice-remove';
-;; - only handles the :before, :after, and :around kinds of advice;
+;; - only handles the :before, :after, :override, and :around kinds of advice;
;; - requires a named rather than anonymous function;
;; - and does not support any additional properties like `name' or `depth'.
;;
@@ -52,6 +52,8 @@
`(progn (apply #',function (ad-get-args 0)) ad-do-it))
((eq where :after)
`(progn ad-do-it (apply #',function (ad-get-args 0))))
+ ((eq where :override)
+ `(setq ad-return-value (apply #',function (ad-get-args 0))))
((eq where :around)
`(setq ad-return-value
(apply #',function
@@ -59,7 +61,8 @@
(ad-set-args 0 nadvice--rest-arg)
ad-do-it)
(ad-get-args 0))))
- (t (error "This version of nadvice.el only handles :before,
:after, and :around")))))
+ (t (error "This version of nadvice.el does not handle %S"
+ where)))))
(ad-add-advice symbol
`(,function nil t (advice lambda () ,body))
'around
- [elpa] branch externals/nadvice created (now 2114e1c), Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice cc671ee 4/9: * nadvice.el: Fix typo, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 6d4e090 6/9: packages/nadvice: Fix advice-remove behaviour, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 2114e1c 9/9: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 2b0e882 1/9: * nadvice: New forward compatibility package, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 7233212 2/9: * nadvice.el: Fix copyright!, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice bc27bdd 3/9: * nadvice/nadvice.el (advice-add): Add support for :override,
Stefan Monnier <=
- [elpa] externals/nadvice 040b27d 5/9: * nadvice.el: ad-remove-advice is not autoloaded, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 1bfa920 7/9: * nadvice/nadvice.el: Silence fewer errors, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 184fdad 8/9: * nadvice/nadvice.el (advice): Require during byte-compilation, Stefan Monnier, 2020/12/01