Commit b32bb3f2 authored by Artur Malabarba's avatar Artur Malabarba

(package--with-work-buffer-async): Protect macro arguments.

parent f674de6f
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* emacs-lisp/package.el (package--download-and-read-archives): Add * emacs-lisp/package.el (package--download-and-read-archives): Add
`package-archives' to `package--downloads-in-progress' instead of `package-archives' to `package--downloads-in-progress' instead of
overwriting it. overwriting it.
(package--with-work-buffer-async): Protect macro arguments.
2015-04-04 Michael Albinus <michael.albinus@gmx.de> 2015-04-04 Michael Albinus <michael.albinus@gmx.de>
......
...@@ -1090,23 +1090,27 @@ function, call it with no arguments (instead of executing BODY), ...@@ -1090,23 +1090,27 @@ function, call it with no arguments (instead of executing BODY),
otherwise propagate the error. For description of the other otherwise propagate the error. For description of the other
arguments see `package--with-work-buffer'." arguments see `package--with-work-buffer'."
(declare (indent 3) (debug t)) (declare (indent 3) (debug t))
`(if (or (not ,async) (macroexp-let2* macroexp-copyable-p
(not (string-match-p "\\`https?:" ,location))) ((async-1 async)
(package--with-work-buffer ,location ,file ,@body) (file-1 file)
(url-retrieve (concat ,location ,file) (location-1 location))
(lambda (status) `(if (or (not ,async-1)
(if (eq (car status) :error) (not (string-match-p "\\`https?:" ,location-1)))
(if (functionp ,async) (package--with-work-buffer ,location-1 ,file-1 ,@body)
(funcall ,async) (url-retrieve (concat ,location-1 ,file-1)
(signal (cdar status) (cddr status))) (lambda (status)
(goto-char (point-min)) (if (eq (car status) :error)
(unless (search-forward "\n\n" nil 'noerror) (if (functionp ,async-1)
(error "Invalid url response")) (funcall ,async-1)
(delete-region (point-min) (point)) (signal (cdar status) (cddr status)))
,@body) (goto-char (point-min))
(kill-buffer (current-buffer))) (unless (search-forward "\n\n" nil 'noerror)
nil (error "Invalid url response"))
'silent))) (delete-region (point-min) (point))
,@body)
(kill-buffer (current-buffer)))
nil
'silent))))
(defun package--check-signature-content (content string &optional sig-file) (defun package--check-signature-content (content string &optional sig-file)
"Check signature CONTENT against STRING. "Check signature CONTENT against STRING.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment