]> code.delx.au - gnu-emacs-elpa/blobdiff - async.el
Merge branch 'master' of github.com:jwiegley/emacs-async
[gnu-emacs-elpa] / async.el
index 8f893b9489bcd3c88d60d82ecf4b7631a3887538..d44f14af51e68d41ff16e1e85d16eb2240bf60eb 100644 (file)
--- a/async.el
+++ b/async.el
@@ -1,10 +1,10 @@
 ;;; async --- Asynchronous processing in Emacs
 
-;; Copyright (C) 2012~2013 John Wiegley
+;; Copyright (C) 2012~2014 John Wiegley
 
 ;; Author: John Wiegley <jwiegley@gmail.com>
 ;; Created: 18 Jun 2012
-;; Version: 1.1
+
 ;; Keywords: async
 ;; X-URL: https://github.com/jwiegley/emacs-async
 
@@ -260,19 +260,18 @@ 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* ((sexp #',start-func)
+  (let ((procvar (make-symbol "proc")))
+    `(let* ((sexp ,start-func)
             (,procvar
              (async-start-process
               "emacs" (file-truename
                        (expand-file-name invocation-name
                                          invocation-directory))
               ,finish-func
-              "-Q" "-l" ,(funcall (symbol-function 'find-library-name)
-                                  "async")
+              "-Q" "-l"
+              ;; Using `locate-library' ensure we use the right file
+              ;; when the .elc have been deleted.
+              ,(locate-library "async")
               "-batch" "-f" "async-batch-invoke"
               (if async-send-over-pipe
                   "<none>"