From 8e05e0208cb91d44c4e10ac6f9532d3cfcd04fe9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Thu, 17 Oct 2013 02:50:54 -0700 Subject: [PATCH] Prevent accidental creation of lexical closures. Fixes #17. (Try async-test-7) --- async.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/async.el b/async.el index 4c79816..8f893b9 100644 --- a/async.el +++ b/async.el @@ -260,8 +260,11 @@ passed to FINISH-FUNC). Call `async-get' on such a future always returns nil. It can still be useful, however, as an argument to `async-ready' or `async-wait'." (require 'find-func) - (let ((procvar (make-symbol "proc"))) - `(let* ((sexp ,start-func) + (let ((procvar (make-symbol "proc")) + ;; Avoid accidental lexical closures by evaluating START-FUNC + ;; in an empty lexical environment. + (start-func (eval start-func t))) + `(let* ((sexp #',start-func) (,procvar (async-start-process "emacs" (file-truename