]> git.eshelyaron.com Git - emacs.git/commit
cconv.el: Fix interactive closure bug#51695
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 23 Sep 2022 20:36:16 +0000 (16:36 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 23 Sep 2022 20:36:16 +0000 (16:36 -0400)
commitc244d4af57deb96ce399c70c2781c54e14e1f0bd
tree6746065f09bb3cabc01a304ede556f6f2aaf3a4d
parent41d39ffc3269db33f35541c94ebf109ffb50681e
cconv.el: Fix interactive closure bug#51695

Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.

* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context.  Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
lisp/emacs-lisp/cconv.el
lisp/emacs-lisp/oclosure.el
lisp/simple.el
test/lisp/emacs-lisp/cconv-tests.el