mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
Fix compilation error with simultaneous dynamic+lexical scoping.
Add warning when a defvar appears after the first let-binding. * lisp/emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var. (byte-compile-close-variables): Initialize it. (byte-compile--declare-var): New function. (byte-compile-file-form-defvar) (byte-compile-file-form-define-abbrev-table) (byte-compile-file-form-custom-declare-variable): Use it. (byte-compile-make-lambda-lexenv): Change the argument. Simplify. (byte-compile-lambda): Share call to byte-compile-arglist-vars. (byte-compile-bind): Handle dynamic bindings that shadow lexical bindings. (byte-compile-unbind): Make arg non-optional. (byte-compile-let): Simplify. * lisp/emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var. (cconv--analyse-function, cconv-analyse-form): Populate it. Protect byte-compile-bound-variables to limit the scope of defvars. (cconv-analyse-form): Add missing rule for (defvar <foo>). Remove unneeded rule for `declare'. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2 so as to avoid depending on cl-adjoin at run-time. * lisp/emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes. * lisp/emacs-lisp/macroexp.el (macroexp--compiling-p): New function. (macroexp--warn-and-return): Use it.
This commit is contained in:
parent
bfa3acd65b
commit
208d0342a3
7 changed files with 143 additions and 89 deletions
|
|
@ -156,8 +156,8 @@ an element already on the list.
|
|||
;; earlier and should have triggered them already.
|
||||
(with-no-warnings ,place)
|
||||
(setq ,place (cons ,var ,place))))
|
||||
(list 'setq place (cl-list* 'cl-adjoin x place keys)))
|
||||
(cl-list* 'cl-callf2 'cl-adjoin x place keys)))
|
||||
`(setq ,place (cl-adjoin ,x ,place ,@keys)))
|
||||
`(cl-callf2 cl-adjoin ,x ,place ,@keys)))
|
||||
|
||||
(defun cl--set-elt (seq n val)
|
||||
(if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue