]> git.eshelyaron.com Git - emacs.git/commitdiff
(package--with-work-buffer-async): Protect macro arguments.
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 4 Apr 2015 19:44:59 +0000 (20:44 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 4 Apr 2015 19:44:59 +0000 (20:44 +0100)
lisp/ChangeLog
lisp/emacs-lisp/package.el

index 9b2b3121439f528de7388df7fbed98fcd7cacddf..11abda5afe60adccc0a5c99add4e120f82696d6f 100644 (file)
@@ -3,6 +3,7 @@
        * emacs-lisp/package.el (package--download-and-read-archives): Add
        `package-archives' to `package--downloads-in-progress' instead of
        overwriting it.
+       (package--with-work-buffer-async): Protect macro arguments.
 
 2015-04-04  Michael Albinus  <michael.albinus@gmx.de>
 
index 3f7784032e4c50b6e616fc710cb74d300e110c4b..32a3e015f0bea68a63f4fa7a2fc112e293bb6474 100644 (file)
@@ -1090,23 +1090,27 @@ function, call it with no arguments (instead of executing BODY),
 otherwise propagate the error.  For description of the other
 arguments see `package--with-work-buffer'."
   (declare (indent 3) (debug t))
-  `(if (or (not ,async)
-           (not (string-match-p "\\`https?:" ,location)))
-       (package--with-work-buffer ,location ,file ,@body)
-     (url-retrieve (concat ,location ,file)
-                   (lambda (status)
-                     (if (eq (car status) :error)
-                         (if (functionp ,async)
-                             (funcall ,async)
-                           (signal (cdar status) (cddr status)))
-                       (goto-char (point-min))
-                       (unless (search-forward "\n\n" nil 'noerror)
-                         (error "Invalid url response"))
-                       (delete-region (point-min) (point))
-                       ,@body)
-                     (kill-buffer (current-buffer)))
-                   nil
-                   'silent)))
+  (macroexp-let2* macroexp-copyable-p
+      ((async-1 async)
+       (file-1 file)
+       (location-1 location))
+    `(if (or (not ,async-1)
+             (not (string-match-p "\\`https?:" ,location-1)))
+         (package--with-work-buffer ,location-1 ,file-1 ,@body)
+       (url-retrieve (concat ,location-1 ,file-1)
+                     (lambda (status)
+                       (if (eq (car status) :error)
+                           (if (functionp ,async-1)
+                               (funcall ,async-1)
+                             (signal (cdar status) (cddr status)))
+                         (goto-char (point-min))
+                         (unless (search-forward "\n\n" nil 'noerror)
+                           (error "Invalid url response"))
+                         (delete-region (point-min) (point))
+                         ,@body)
+                       (kill-buffer (current-buffer)))
+                     nil
+                     'silent))))
 
 (defun package--check-signature-content (content string &optional sig-file)
   "Check signature CONTENT against STRING.