summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/advice.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-09-19 22:33:34 +0200
committerAndrea Corallo <akrl@sdf.org>2020-09-24 09:57:17 +0200
commitdb354ffd578a46d898cac161ea1de1b42f96d2a0 (patch)
tree2fb34c0a511c9bef424d9f468387db89ac212561 /lisp/emacs-lisp/advice.el
parent3ec1b932c9c57d200c3a3f2fb9a0c59c4acc8011 (diff)
downloademacs-db354ffd578a46d898cac161ea1de1b42f96d2a0.tar.gz
emacs-db354ffd578a46d898cac161ea1de1b42f96d2a0.tar.bz2
emacs-db354ffd578a46d898cac161ea1de1b42f96d2a0.zip
Call `comp--subr-safe-advice' from the advice machinery
* lisp/emacs-lisp/nadvice.el (advice--add-function): Call `comp--subr-safe-advice' when necessary. * lisp/emacs-lisp/advice.el (ad-add-advice): Likewhise.
Diffstat (limited to 'lisp/emacs-lisp/advice.el')
-rw-r--r--lisp/emacs-lisp/advice.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 0ebd2741d2e..4c19197024d 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2075,6 +2075,8 @@ mapped to the closest extremal position).
If FUNCTION was not advised already, its advice info will be
initialized. Redefining a piece of advice whose name is part of
the cache-id will clear the cache."
+ (when (subr-primitive-p (symbol-function function))
+ (comp--subr-safe-advice function))
(cond ((not (ad-is-advised function))
(ad-initialize-advice-info function)
(ad-set-advice-info-field