]> git.eshelyaron.com Git - emacs.git/commitdiff
Check if lexical-binding is enabled before warning
authorPhilip Kaludercic <philipk@posteo.net>
Tue, 2 Apr 2024 16:01:27 +0000 (18:01 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 4 Apr 2024 11:39:01 +0000 (13:39 +0200)
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Suppress "file
has no `lexical-binding' directive" is the variable is non-nil,
as is the case with 'lisp-interaction-mode'.  (Bug#70068)

(cherry picked from commit 7de192680fdac6938f5704aea0310b85b0da9c5e)

lisp/emacs-lisp/bytecomp.el

index 5cff86784f07b2368e065b48666e8f0bf9f5c2f1..3af7ede4c8ea3af356a08e09a090bf6dc2359771 100644 (file)
@@ -2234,7 +2234,8 @@ See also `emacs-lisp-byte-compile-and-load'."
         (setq buffer-read-only nil
               filename buffer-file-name))
       ;; Don't inherit lexical-binding from caller (bug#12938).
-      (unless (local-variable-p 'lexical-binding)
+      (unless (or (local-variable-p 'lexical-binding)
+                  (null lexical-binding))
         (let ((byte-compile-current-buffer (current-buffer)))
           (displaying-byte-compile-warnings
            (byte-compile-warn-x