diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-04-04 20:44:59 +0100 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-04-04 20:44:59 +0100 |
commit | b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb (patch) | |
tree | 536cedf9dae202df0432ad92f8715468db64a618 /lisp/emacs-lisp | |
parent | f674de6f08e3789fed88f24ffc45bfffc8d60520 (diff) | |
download | emacs-b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb.tar.gz emacs-b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb.tar.bz2 emacs-b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb.zip |
(package--with-work-buffer-async): Protect macro arguments.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/package.el | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3f7784032e4..32a3e015f0b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -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. |