diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-06-02 11:08:50 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-06-22 00:03:23 +0200 |
commit | 29b2a08c36554ec26f8f3c51da2a2a26b13bfe8f (patch) | |
tree | 4ecc9985a4ea16756f75a746e95a97d5a2c46bc4 /lisp/emacs-lisp/comp.el | |
parent | 47ab6c237e703cf4b5bbcd3c301e324e0deb1173 (diff) | |
download | emacs-29b2a08c36554ec26f8f3c51da2a2a26b13bfe8f.tar.gz emacs-29b2a08c36554ec26f8f3c51da2a2a26b13bfe8f.tar.bz2 emacs-29b2a08c36554ec26f8f3c51da2a2a26b13bfe8f.zip |
Execute top level forms in the right lex/dyn scope.
* lisp/emacs-lisp/bytecomp.el (byte-to-native-top-level): Add
'lexical' slot.
(byte-compile-output-file-form): Update for new slot.
(byte-compile-file-form-defmumble): Capture scope.
* lisp/emacs-lisp/comp.el (comp-emit-for-top-level): Specify
execution scope.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index e7bd0690727..928fa516ed5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1373,11 +1373,13 @@ the annotation emission." (cl-defmethod comp-emit-for-top-level ((form byte-to-native-top-level) for-late-load) (unless for-late-load - (let ((form (byte-to-native-top-level-form form))) - (comp-emit (comp-call 'eval - (let ((comp-curr-allocation-class 'd-impure)) - (make-comp-mvar :constant form)) - (make-comp-mvar :constant t)))))) + (comp-emit + (comp-call 'eval + (let ((comp-curr-allocation-class 'd-impure)) + (make-comp-mvar :constant + (byte-to-native-top-level-form form))) + (make-comp-mvar :constant + (byte-to-native-top-level-lexical form)))))) (defun comp-emit-lambda-for-top-level (func) "Emit the creation of subrs for lambda FUNC. |