diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2024-05-03 17:58:44 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2024-05-03 19:27:26 +0200 |
commit | 81bad84a617be38459da313a75719b5627bb15fe (patch) | |
tree | b51c9ca6d4fc68e8b6a865c698fafce92aa19244 /etc/NEWS | |
parent | b6d4e81a487ce40f5ea6520c53a88a1c2e7359a9 (diff) | |
download | emacs-81bad84a617be38459da313a75719b5627bb15fe.tar.gz |
Warn when loading .el files without lexical-binding declaration
This corresponds to the byte-compiler warning for the same issue,
here emitted for files that aren't compiled but loaded from source.
It should make the planned change to enable lexical binding by default
in Emacs 31 go smoother.
* src/lread.c (lexical_cookie_t): New type.
(lisp_file_lexically_bound_p): Renamed to...
(lisp_file_lexical_cookie): ...this, with the return value retyped.
* src/lread.c (warn_missing_cookie): New.
(Fload): Warn when loading source file and cookie missing.
(Feval_buffer): Add LOADING arg; warn when set and cookie missing.
* lisp/international/mule.el (load-with-code-conversion):
* lisp/startup.el (command-line--load-script):
Call eval-buffer with LOADING arg set.
* etc/NEWS: Announce.
Diffstat (limited to 'etc/NEWS')
-rw-r--r-- | etc/NEWS | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2423,6 +2423,13 @@ The warning name is 'docstrings-control-chars'. Its warning name is 'docstrings-wide'. --- +** Warn about missing 'lexical-binding' directive when loading .el files. +Emacs now emits a run-time warning if an Elisp source file being loaded +lacks the '-*- lexical-binding: ... -*-' cookie on the first line. +See the lexical-binding compiler warning described above for how to make +the warning go away. + +--- ** New user option 'native-comp-async-warnings-errors-kind'. It allows control of what kinds of warnings and errors from asynchronous native compilation are reported to the parent Emacs process. The |