1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

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.
This commit is contained in:
Andrea Corallo 2020-09-19 22:33:34 +02:00
parent 3ec1b932c9
commit db354ffd57
2 changed files with 18 additions and 0 deletions

View file

@ -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