1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-13 11:12:19 -08:00
emacs/doc
Mattias Engdegård 3217ae6e05 Add aid for finding missing dynamic variable declarations
Find lexical use of variables that are dynamically declared in other
files by recording 'defvar' declarations in files that can be read
in by the compiler in a second compilation.  This is particularly
useful when converting code to use lexical-binding.

The facility is controlled by setting environment variables:

 EMACS_GENERATE_DYNVARS -- set to non-empty to generate a .dynvars file
                           corresponding to each .elc.
 EMACS_DYNVARS_FILE     -- set to the name of a .dynvars file to use
                           as defvar information during compilation,
                           enabling the new warnings.

* lisp/emacs-lisp/bytecomp.el (byte-compile--known-dynamic-vars)
(byte-compile--seen-defvars): New variables.
(byte-compile-warning-types): Add lexical-dynamic warning.
(byte-compile--load-dynvars, byte-compile--warn-lexical-dynamic):
New functions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file, byte-compile--declare-var)
(byte-compile-lambda, byte-compile-bind): Add dynamic variable loads,
dumps and checks.
* doc/lispref/variables.texi (Converting to Lexical Binding): Document.
2020-10-17 16:57:38 +02:00
..
emacs ; * doc/emacs/ack.texi (Acknowledgments): Tweak the purpose description. 2020-10-16 18:42:22 +03:00
lispintro Clarify wording 2020-10-14 19:17:48 -04:00
lispref Add aid for finding missing dynamic variable declarations 2020-10-17 16:57:38 +02:00
man Move emacsclient.1 file history further down 2020-10-15 14:52:02 +02:00
misc ; A few more spelling fixes in Modus Theme docs. 2020-10-16 17:32:04 +03:00