diff options
| author | Lars Magne Ingebrigtsen | 2014-11-23 15:05:18 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-11-23 15:05:18 +0100 |
| commit | a345ff6bf2af54db2ee03296965165127f7758ec (patch) | |
| tree | de73d6a88dca950fca75e41bf0c7bcf120713cb0 | |
| parent | c43b706ab3a699c107a91d1ab6f16014fff65b54 (diff) | |
| download | emacs-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.
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | lisp/url/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/url/url-http.el | 6 | ||||
| -rw-r--r-- | lisp/url/url-queue.el | 9 | ||||
| -rw-r--r-- | lisp/url/url-vars.el | 3 |
6 files changed, 35 insertions, 6 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index d57190fce01..867e4f5f09c 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * NEWS: Mention `url-request-noninteractive'. | ||
| 4 | |||
| 1 | 2014-11-19 Leo Liu <sdl.web@gmail.com> | 5 | 2014-11-19 Leo Liu <sdl.web@gmail.com> |
| 2 | 6 | ||
| 3 | * NEWS: Mention new macro define-advice. | 7 | * NEWS: Mention new macro define-advice. |
| @@ -262,14 +262,20 @@ plain text parts, if display of HTML email is possible; customize the | |||
| 262 | ** In sh-mode, you can now use `sh-shell' as a file-local variable to | 262 | ** In sh-mode, you can now use `sh-shell' as a file-local variable to |
| 263 | specify the type of shell in use (bash, csh, etc). | 263 | specify the type of shell in use (bash, csh, etc). |
| 264 | 264 | ||
| 265 | ** The URL package accepts now the protocols "ssh", "scp" and "rsync". | 265 | ** URL |
| 266 | |||
| 267 | *** The URL package accepts now the protocols "ssh", "scp" and "rsync". | ||
| 266 | When `url-handler-mode' is enabled, file operations for these | 268 | When `url-handler-mode' is enabled, file operations for these |
| 267 | protocols as well as for "telnet" and "ftp" are passed to Tramp. | 269 | protocols as well as for "telnet" and "ftp" are passed to Tramp. |
| 268 | 270 | ||
| 269 | ** The URL package allows customizing the `url-user-agent' string. | 271 | *** The URL package allows customizing the `url-user-agent' string. |
| 270 | The new `url-user-agent' variable can be customized to be a string or | 272 | The new `url-user-agent' variable can be customized to be a string or |
| 271 | a function. | 273 | a function. |
| 272 | 274 | ||
| 275 | *** The new interface variable `url-request-noninteractive' can be used | ||
| 276 | to specify that we're running in a noninteractive context, and that | ||
| 277 | we should not be queried about things like TLS certificate validity. | ||
| 278 | |||
| 273 | ** Tramp | 279 | ** Tramp |
| 274 | 280 | ||
| 275 | *** New connection method "nc", which allows to access dumb busyboxes. | 281 | *** New connection method "nc", which allows to access dumb busyboxes. |
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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-11-14 David Reitter <david.reitter@gmail.com> | 10 | 2014-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. |
| 210 | Should be an assoc list of headers/contents.") | 210 | Should 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) |