]> git.eshelyaron.com Git - emacs.git/commit
Warn when loading .el files without lexical-binding declaration
authorMattias EngdegÄrd <mattiase@acm.org>
Fri, 3 May 2024 15:58:44 +0000 (17:58 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:37:52 +0000 (18:37 +0200)
commit7fecffeaeb97ca4374016792a057d625f6835e7b
treed7bd032689b21c8c2e004b57fe05ba21722a3499
parent8c41ad56b10e52362de4b5fa278828601f7ccfbc
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.

(cherry picked from commit 81bad84a617be38459da313a75719b5627bb15fe)
etc/NEWS
lisp/international/mule.el
lisp/startup.el
src/lread.c