aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Malabarba2015-04-04 20:44:59 +0100
committerArtur Malabarba2015-04-04 20:44:59 +0100
commitb32bb3f2f6ae6b76d9cc74dbace2745ee119eddb (patch)
tree536cedf9dae202df0432ad92f8715468db64a618
parentf674de6f08e3789fed88f24ffc45bfffc8d60520 (diff)
downloademacs-b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb.tar.gz
emacs-b32bb3f2f6ae6b76d9cc74dbace2745ee119eddb.zip
(package--with-work-buffer-async): Protect macro arguments.
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/emacs-lisp/package.el38
2 files changed, 22 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9b2b3121439..11abda5afe6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,7 @@
3 * emacs-lisp/package.el (package--download-and-read-archives): Add 3 * emacs-lisp/package.el (package--download-and-read-archives): Add
4 `package-archives' to `package--downloads-in-progress' instead of 4 `package-archives' to `package--downloads-in-progress' instead of
5 overwriting it. 5 overwriting it.
6 (package--with-work-buffer-async): Protect macro arguments.
6 7
72015-04-04 Michael Albinus <michael.albinus@gmx.de> 82015-04-04 Michael Albinus <michael.albinus@gmx.de>
8 9
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),
1090otherwise propagate the error. For description of the other 1090otherwise propagate the error. For description of the other
1091arguments see `package--with-work-buffer'." 1091arguments see `package--with-work-buffer'."
1092 (declare (indent 3) (debug t)) 1092 (declare (indent 3) (debug t))
1093 `(if (or (not ,async) 1093 (macroexp-let2* macroexp-copyable-p
1094 (not (string-match-p "\\`https?:" ,location))) 1094 ((async-1 async)
1095 (package--with-work-buffer ,location ,file ,@body) 1095 (file-1 file)
1096 (url-retrieve (concat ,location ,file) 1096 (location-1 location))
1097 (lambda (status) 1097 `(if (or (not ,async-1)
1098 (if (eq (car status) :error) 1098 (not (string-match-p "\\`https?:" ,location-1)))
1099 (if (functionp ,async) 1099 (package--with-work-buffer ,location-1 ,file-1 ,@body)
1100 (funcall ,async) 1100 (url-retrieve (concat ,location-1 ,file-1)
1101 (signal (cdar status) (cddr status))) 1101 (lambda (status)
1102 (goto-char (point-min)) 1102 (if (eq (car status) :error)
1103 (unless (search-forward "\n\n" nil 'noerror) 1103 (if (functionp ,async-1)
1104 (error "Invalid url response")) 1104 (funcall ,async-1)
1105 (delete-region (point-min) (point)) 1105 (signal (cdar status) (cddr status)))
1106 ,@body) 1106 (goto-char (point-min))
1107 (kill-buffer (current-buffer))) 1107 (unless (search-forward "\n\n" nil 'noerror)
1108 nil 1108 (error "Invalid url response"))
1109 'silent))) 1109 (delete-region (point-min) (point))
1110 ,@body)
1111 (kill-buffer (current-buffer)))
1112 nil
1113 'silent))))
1110 1114
1111(defun package--check-signature-content (content string &optional sig-file) 1115(defun package--check-signature-content (content string &optional sig-file)
1112 "Check signature CONTENT against STRING. 1116 "Check signature CONTENT against STRING.