]> git.eshelyaron.com Git - emacs.git/commitdiff
(byte-compile): Fix interaction with old `advice.el`
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 29 Apr 2024 17:14:31 +0000 (13:14 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 29 Apr 2024 19:48:30 +0000 (21:48 +0200)
* lisp/emacs-lisp/bytecomp.el (byte-compile): Handle symbols whose
function "value" is a bare lambda expression (bug#70368).

(cherry picked from commit 7cf767ef54f2cf1d2873fe4dd07664b401d8044b)

lisp/emacs-lisp/bytecomp.el

index 7aae87c50dcc788704966a921d98b87a0903fa4e..6b7b804d7debcc4e502593876d6316a997a70ba4 100644 (file)
@@ -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))