summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/syntax-tests.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-10-16 19:02:25 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2020-10-17 16:57:38 +0200
commit3217ae6e05c5d99f5d2d364b8f631001ee1d29c9 (patch)
treef168d63122d599d493f35b0e6f3388ff14972a23 /test/lisp/emacs-lisp/syntax-tests.el
parent39a001451fba253bf9480d1a0347ae054760f8e2 (diff)
downloademacs-3217ae6e05c5d99f5d2d364b8f631001ee1d29c9.tar.gz
emacs-3217ae6e05c5d99f5d2d364b8f631001ee1d29c9.tar.bz2
emacs-3217ae6e05c5d99f5d2d364b8f631001ee1d29c9.zip
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.
Diffstat (limited to 'test/lisp/emacs-lisp/syntax-tests.el')
0 files changed, 0 insertions, 0 deletions