diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-06-13 22:31:28 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-06-13 22:31:28 -0400 |
commit | 0b31660d3c10a0f8e243dd67bd0ecaf2c847d1e6 (patch) | |
tree | c98ad57350666702eb75c8c0978f8d7c8e55f8e7 /lisp/emacs-lisp/cconv.el | |
parent | 99c812809854a1405ba879814b8ae9a09e82a5e4 (diff) | |
download | emacs-0b31660d3c10a0f8e243dd67bd0ecaf2c847d1e6.tar.gz |
* lisp/emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): New var.
(byte-compile-preprocess): Use it.
(byte-compile-file-form-defalias): Try a bit harder to use macros we
can't quite recognize.
(byte-compile-add-to-list): Remove.
* lisp/emacs-lisp/cconv.el (cconv-warnings-only): New function.
(cconv-closure-convert): Add assertion.
* lisp/emacs-lisp/map-ynp.el: Use lexical-binding.
(map-y-or-n-p): Remove unused vars `tail' and `object'.
Factor out some repeated code.
* etc/NEWS (utf-8 for el): Move to the incompatible section.
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r-- | lisp/emacs-lisp/cconv.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 761e33c059d..70fa71a0da4 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -143,7 +143,19 @@ Returns a form where all lambdas don't have any free variables." ;; Analyze form - fill these variables with new information. (cconv-analyse-form form '()) (setq cconv-freevars-alist (nreverse cconv-freevars-alist)) - (cconv-convert form nil nil))) ; Env initially empty. + (prog1 (cconv-convert form nil nil) ; Env initially empty. + (cl-assert (null cconv-freevars-alist))))) + +;;;###autoload +(defun cconv-warnings-only (form) + "Add the warnings that closure conversion would encounter." + (let ((cconv-freevars-alist '()) + (cconv-lambda-candidates '()) + (cconv-captured+mutated '())) + ;; Analyze form - fill these variables with new information. + (cconv-analyse-form form '()) + ;; But don't perform the closure conversion. + form)) (defconst cconv--dummy-var (make-symbol "ignored")) |