diff options
author | Philip Kaludercic <philipk@posteo.net> | 2024-04-02 18:01:27 +0200 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2024-04-03 10:52:12 +0200 |
commit | 7de192680fdac6938f5704aea0310b85b0da9c5e (patch) | |
tree | 9ef20872b4e9f8a4a4f39e75df72cd52a7d3e495 /lisp/emacs-lisp | |
parent | 375ba7c8ea4e8c8bc7f08dedfc46884ffb908622 (diff) | |
download | emacs-7de192680fdac6938f5704aea0310b85b0da9c5e.tar.gz emacs-7de192680fdac6938f5704aea0310b85b0da9c5e.tar.bz2 emacs-7de192680fdac6938f5704aea0310b85b0da9c5e.zip |
Check if lexical-binding is enabled before warning
* 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)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5cff86784f0..3af7ede4c8e 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -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 |