Subject: Re: bug#70068: [PATCH] Don't warn about lexical binding in lisp-interaction-mode

From: Philip Kaludercic <[email-masked]>
Date: Wed, 03 Apr 2024 18:17:16 +0000

Mattias Engdegård <[email-masked]> writes:

>> -      (unless (local-variable-p 'lexical-binding)
>> +      (unless (or (local-variable-p 'lexical-binding)
>> +                  (null lexical-binding))
>
> That logic doesn't make sense to me, and it clearly doesn't work so I reverted it.
> (For some reason the test didn't catch it, but it's now been made more robust.)

You are right, I made a mistake; What I want to say is this:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 5cff86784f0..a1194f2dc70 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2234,7 +2234,8 @@ byte-compile-file
         (setq buffer-read-only nil
               filename buffer-file-name))
       ;; Don't inherit lexical-binding from caller (bug#12938).
-      (unless (local-variable-p 'lexical-binding)
+      (when (or (not (local-variable-p 'lexical-binding))
+                (null lexical-binding))
         (let ((byte-compile-current-buffer (current-buffer)))
           (displaying-byte-compile-warnings
            (byte-compile-warn-x
--8<---------------cut here---------------end--------------->8---

What makes me uncertain is that you say it makes "no sense", so I  want
to make sure I am not misunderstanding something completely.

-- 
	Philip Kaludercic on peregrine