[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 93b05a9 073/187: More robust evaluation and closure-protec
From: |
Michael Albinus |
Subject: |
[elpa] master 93b05a9 073/187: More robust evaluation and closure-protection of start-func |
Date: |
Wed, 30 Dec 2015 11:49:46 +0000 |
branch: master
commit 93b05a955584cd8f3f7b75c5888c41db7bc7c878
Author: Ryan C. Thompson <address@hidden>
Commit: Ryan C. Thompson <address@hidden>
More robust evaluation and closure-protection of start-func
---
async.el | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/async.el b/async.el
index 8f893b9..c4485d6 100644
--- a/async.el
+++ b/async.el
@@ -260,10 +260,21 @@ 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"))
- ;; Avoid accidental lexical closures by evaluating START-FUNC
- ;; in an empty lexical environment.
- (start-func (eval start-func t)))
+ (let* ((procvar (make-symbol "proc"))
+ ;; Evaluate START-FUNC if it isn't aready a function.
+ (start-func
+ (if (functionp start-func)
+ start-func
+ (eval start-func)))
+ (start-func
+ (if (eq (car start-func) 'lambda)
+ (eval start-func t)
+ start-func)))
+ ;; If START-FUNC is a lambda, prevent it from creating a lexical
+ ;; closure by evaluating it in an empty lexical environment.
+ (when (eq (car start-func) 'lambda)
+ (setq start-func
+ (eval start-func t)))
`(let* ((sexp #',start-func)
(,procvar
(async-start-process
- [elpa] master 9585ae1 058/187: * helm-async.el (helm-async-env-variables-regexp): Fix for copying from android devices., (continued)
- [elpa] master 9585ae1 058/187: * helm-async.el (helm-async-env-variables-regexp): Fix for copying from android devices., Michael Albinus, 2015/12/30
- [elpa] master 3544948 064/187: * helm-async.el (dired-create-files): No need to backquote callback., Michael Albinus, 2015/12/30
- [elpa] master 8d38306 063/187: * helm-async.el: Untabify and reindent., Michael Albinus, 2015/12/30
- [elpa] master c029934 066/187: * helm-async.el: Add comments about incompatibility with dired-async.el and async-file.el., Michael Albinus, 2015/12/30
- [elpa] master fb8f10b 065/187: * helm-async.el (dired-create-files): Handle `dired-recursive-copies' when async too., Michael Albinus, 2015/12/30
- [elpa] master bcffaeb 067/187: * helm-async.el (dired-create-file): Revert changes in fb8f10b., Michael Albinus, 2015/12/30
- [elpa] master 8e05e02 070/187: Prevent accidental creation of lexical closures., Michael Albinus, 2015/12/30
- [elpa] master 9c02acd 069/187: Add test for #17., Michael Albinus, 2015/12/30
- [elpa] master 5ef546a 071/187: Have test file add its own directory to load path, Michael Albinus, 2015/12/30
- [elpa] master 242ae73 068/187: * helm-async.el: Fix error handling., Michael Albinus, 2015/12/30
- [elpa] master 93b05a9 073/187: More robust evaluation and closure-protection of start-func,
Michael Albinus <=
- [elpa] master ba705c6 076/187: Add test for handling different ways of passing a function, Michael Albinus, 2015/12/30
- [elpa] master b6d990d 075/187: Add lexbind test, Michael Albinus, 2015/12/30
- [elpa] master f6d7a74 074/187: Merge pull request #18 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 9b5bb5c 072/187: Add more comprehensive testing for anti-closure feature, Michael Albinus, 2015/12/30
- [elpa] master 204750d 081/187: Revert "* helm-async.el: Fix error handling.", Michael Albinus, 2015/12/30
- [elpa] master b05c63a 083/187: Don't rely on async.el being in load-path., Michael Albinus, 2015/12/30
- [elpa] master 374f514 079/187: Complete the docstring for "async--get-function", Michael Albinus, 2015/12/30
- [elpa] master 9704eb8 080/187: Merge pull request #21 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 4a7b07b 084/187: Merge pull request #23 from DarwinAwardWinner/no-load-path-fix, Michael Albinus, 2015/12/30
- [elpa] master 2a532d3 077/187: Replace closure prevention with closure sanitation, Michael Albinus, 2015/12/30