aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2014-11-23 15:05:18 +0100
committerLars Magne Ingebrigtsen2014-11-23 15:05:18 +0100
commita345ff6bf2af54db2ee03296965165127f7758ec (patch)
treede73d6a88dca950fca75e41bf0c7bcf120713cb0 /lisp
parentc43b706ab3a699c107a91d1ab6f16014fff65b54 (diff)
downloademacs-a345ff6bf2af54db2ee03296965165127f7758ec.tar.gz
emacs-a345ff6bf2af54db2ee03296965165127f7758ec.zip
Implement a new url parameter `url-request-noninteractive'
* url-http.el (url-http): Respect `url-request-noninteractive'. * url-queue.el (url-queue-start-retrieve): Fetching through url-queue should always be noninteractive. * url-vars.el (url-request-noninteractive): New variable.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/url/ChangeLog9
-rw-r--r--lisp/url/url-http.el6
-rw-r--r--lisp/url/url-queue.el9
-rw-r--r--lisp/url/url-vars.el3
4 files changed, 23 insertions, 4 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 1be4ca70a80..7ba9de0f761 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,12 @@
12014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * url-http.el (url-http): Respect `url-request-noninteractive'.
4
5 * url-queue.el (url-queue-start-retrieve): Fetching through
6 url-queue should always be noninteractive.
7
8 * url-vars.el (url-request-noninteractive): New variable.
9
12014-11-14 David Reitter <david.reitter@gmail.com> 102014-11-14 David Reitter <david.reitter@gmail.com>
2 11
3 * url-domsuf.el (url-domsuf-parse-file): Read compressed 12 * url-domsuf.el (url-domsuf-parse-file): Read compressed
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index a51785a5129..1001c4deada 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -40,6 +40,7 @@
40(defvar url-http-data) 40(defvar url-http-data)
41(defvar url-http-end-of-headers) 41(defvar url-http-end-of-headers)
42(defvar url-http-extra-headers) 42(defvar url-http-extra-headers)
43(defvar url-http-noninteractive)
43(defvar url-http-method) 44(defvar url-http-method)
44(defvar url-http-no-retry) 45(defvar url-http-no-retry)
45(defvar url-http-process) 46(defvar url-http-process)
@@ -1201,6 +1202,9 @@ overriding the value of `url-gateway-method'."
1201 (cl-check-type url vector "Need a pre-parsed URL.") 1202 (cl-check-type url vector "Need a pre-parsed URL.")
1202 (let* ((host (url-host (or url-using-proxy url))) 1203 (let* ((host (url-host (or url-using-proxy url)))
1203 (port (url-port (or url-using-proxy url))) 1204 (port (url-port (or url-using-proxy url)))
1205 (nsm-noninteractive (or url-request-noninteractive
1206 (and (boundp 'url-http-noninteractive)
1207 url-http-noninteractive)))
1204 (connection (url-http-find-free-connection host port gateway-method)) 1208 (connection (url-http-find-free-connection host port gateway-method))
1205 (buffer (or retry-buffer 1209 (buffer (or retry-buffer
1206 (generate-new-buffer 1210 (generate-new-buffer
@@ -1232,6 +1236,7 @@ overriding the value of `url-gateway-method'."
1232 url-http-process 1236 url-http-process
1233 url-http-method 1237 url-http-method
1234 url-http-extra-headers 1238 url-http-extra-headers
1239 url-http-noninteractive
1235 url-http-data 1240 url-http-data
1236 url-http-target-url 1241 url-http-target-url
1237 url-http-no-retry 1242 url-http-no-retry
@@ -1241,6 +1246,7 @@ overriding the value of `url-gateway-method'."
1241 1246
1242 (setq url-http-method (or url-request-method "GET") 1247 (setq url-http-method (or url-request-method "GET")
1243 url-http-extra-headers url-request-extra-headers 1248 url-http-extra-headers url-request-extra-headers
1249 url-http-noninteractive url-request-noninteractive
1244 url-http-data url-request-data 1250 url-http-data url-request-data
1245 url-http-process connection 1251 url-http-process connection
1246 url-http-chunked-length nil 1252 url-http-chunked-length nil
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 87469b91032..9c4b4028741 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -133,10 +133,11 @@ The variable `url-queue-timeout' sets a timeout."
133(defun url-queue-start-retrieve (job) 133(defun url-queue-start-retrieve (job)
134 (setf (url-queue-buffer job) 134 (setf (url-queue-buffer job)
135 (ignore-errors 135 (ignore-errors
136 (url-retrieve (url-queue-url job) 136 (let ((url-request-noninteractive t))
137 #'url-queue-callback-function (list job) 137 (url-retrieve (url-queue-url job)
138 (url-queue-silentp job) 138 #'url-queue-callback-function (list job)
139 (url-queue-inhibit-cookiesp job))))) 139 (url-queue-silentp job)
140 (url-queue-inhibit-cookiesp job))))))
140 141
141(defun url-queue-prune-old-entries () 142(defun url-queue-prune-old-entries ()
142 (let (dead-jobs) 143 (let (dead-jobs)
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index 62b7b855533..bc23b982f82 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -209,6 +209,9 @@ document."
209 "A list of extra headers to send with the next request. 209 "A list of extra headers to send with the next request.
210Should be an assoc list of headers/contents.") 210Should be an assoc list of headers/contents.")
211 211
212(defvar url-request-noninteractive nil
213 "If non-nil, the request is done in a noninteractive context.")
214
212(defvar url-request-method nil "The method to use for the next request.") 215(defvar url-request-method nil "The method to use for the next request.")
213 216
214(defvar url-mime-encoding-string (and (fboundp 'zlib-available-p) 217(defvar url-mime-encoding-string (and (fboundp 'zlib-available-p)