diff options
| author | Stefan Monnier | 2012-11-12 22:00:09 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2012-11-12 22:00:09 -0500 |
| commit | 413d4689c0c3f616856615ac7b8bb047c5f2febd (patch) | |
| tree | 3f2ca64880fb237665d78b4d19d1fe4ab400fb6a /test | |
| parent | f78ee6afc094cdfd6162bfd645836e84875dcddf (diff) | |
| download | emacs-413d4689c0c3f616856615ac7b8bb047c5f2febd.tar.gz emacs-413d4689c0c3f616856615ac7b8bb047c5f2febd.zip | |
* lisp/emacs-lisp/cl.el (dolist, dotimes, declare): Use advice-add to
override the default.
* lisp/emacs-lisp/cl-macs.el (cl-dolist, cl-dotimes): Rewrite without using
cl--dotimes/dolist.
* lisp/subr.el (dolist, dotimes, declare): Redefine them normally, even when
`cl' is loaded.
* lisp/emacs-lisp/nadvice.el (advice--normalize): New function, extracted
from add-advice.
(advice--strip-macro): New function.
(advice--defalias-fset): Use them to handle macros.
(advice-add): Use them.
(advice-member-p): Correctly handle macros.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/advice-tests.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/automated/advice-tests.el b/test/automated/advice-tests.el index cac10e9602f..9f9719fdcfc 100644 --- a/test/automated/advice-tests.el +++ b/test/automated/advice-tests.el | |||
| @@ -50,6 +50,13 @@ | |||
| 50 | ((ad-activate 'sm-test2) | 50 | ((ad-activate 'sm-test2) |
| 51 | (sm-test2 6) 20) | 51 | (sm-test2 6) 20) |
| 52 | ((null (get 'sm-test2 'defalias-fset-function)) t) | 52 | ((null (get 'sm-test2 'defalias-fset-function)) t) |
| 53 | |||
| 54 | ((advice-add 'sm-test3 :around | ||
| 55 | (lambda (f &rest args) `(toto ,(apply f args))) | ||
| 56 | '((name . wrap-with-toto))) | ||
| 57 | (defmacro sm-test3 (x) `(call-test3 ,x)) | ||
| 58 | (macroexpand '(sm-test3 56)) (toto (call-test3 56))) | ||
| 59 | |||
| 53 | )) | 60 | )) |
| 54 | 61 | ||
| 55 | (ert-deftest advice-tests () | 62 | (ert-deftest advice-tests () |