From: Stefan Monnier Date: Mon, 29 Apr 2024 17:14:31 +0000 (-0400) Subject: (byte-compile): Fix interaction with old `advice.el` X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=81aba4df41e718e0922d0e904100439022ebacd8;p=emacs.git (byte-compile): Fix interaction with old `advice.el` * lisp/emacs-lisp/bytecomp.el (byte-compile): Handle symbols whose function "value" is a bare lambda expression (bug#70368). (cherry picked from commit 7cf767ef54f2cf1d2873fe4dd07664b401d8044b) --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7aae87c50dc..6b7b804d7de 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2962,8 +2962,10 @@ If FORM is a lambda or a macro, byte-compile it as a function." (when (or (symbolp form) (interpreted-function-p fun)) ;; `fun' is a function *value*, so try to recover its ;; corresponding source code. - (setq lexical-binding (not (null (aref fun 2)))) - (setq fun (byte-compile--reify-function fun)) + (if (not (interpreted-function-p fun)) + (setq lexical-binding nil) + (setq lexical-binding (not (null (aref fun 2)))) + (setq fun (byte-compile--reify-function fun))) (setq need-a-value t)) ;; Expand macros. (setq fun (byte-compile-preprocess fun))