diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-07-13 00:42:38 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-08-07 18:54:49 -0400 |
commit | 79a74568e9166f63a12adb30f54edcd57a6405a3 (patch) | |
tree | f228a53ad54805030c7bde905604aa4a4d08b816 /lisp | |
parent | b5c8e9898d9dbd4145c40d08e8eef84a5e32008a (diff) | |
download | emacs-79a74568e9166f63a12adb30f54edcd57a6405a3.tar.gz emacs-79a74568e9166f63a12adb30f54edcd57a6405a3.tar.bz2 emacs-79a74568e9166f63a12adb30f54edcd57a6405a3.zip |
Don't define gv expanders in compiler's runtime (Bug#27016)
This prevents definitions being compiled from leaking into the current
Emacs doing the compilation.
* lisp/emacs-lisp/gv.el (gv-define-expander): Use function-put instead
of `put' with `eval-and-compile'.
* test/lisp/emacs-lisp/gv-tests.el: New tests.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emacs-lisp/gv.el | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 27376fc7f95..a8b8974cb4f 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -146,12 +146,7 @@ NAME is a symbol: the name of a function, macro, or special form. HANDLER is a function which takes an argument DO followed by the same arguments as NAME. DO is a function as defined in `gv-get'." (declare (indent 1) (debug (sexp form))) - ;; Use eval-and-compile so the method can be used in the same file as it - ;; is defined. - ;; FIXME: Just like byte-compile-macro-environment, we should have something - ;; like byte-compile-symbolprop-environment so as to handle these things - ;; cleanly without affecting the running Emacs. - `(eval-and-compile (put ',name 'gv-expander ,handler))) + `(function-put ',name 'gv-expander ,handler)) ;;;###autoload (defun gv--defun-declaration (symbol name args handler &optional fix) |