From 647b489cdffab43432538ef966c31f714dae2824 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 30 May 2024 18:57:56 -0400 Subject: [PATCH] ad-activate-advised-definition: Use proper function objects * lisp/emacs-lisp/advice.el (ad-activate-advised-definition): Use interpreted functions rather than lambda lists. (cherry picked from commit 2e16bcd8ede77e41e0caaf71e1d22edadadc79dd) --- lisp/emacs-lisp/advice.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 752660156b9..73d11fc8aa8 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2845,7 +2845,11 @@ The current definition and its cache-id will be put into the cache." (old-ispec (interactive-form advicefunname))) (fset advicefunname (or verified-cached-definition - (ad-make-advised-definition function))) + (eval + (ad-make-advised-definition function) + ;; We don't keep track of the `lexical-binding' of the + ;; various chunks: assume it's the old dynbound dialect. + nil))) (put advicefunname 'function-documentation `(ad--make-advised-docstring ',advicefunname)) (unless (equal (interactive-form advicefunname) old-ispec) -- 2.39.2