[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] nsm 02/02: Introduce a new `url-request-noninteractive' in
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] nsm 02/02: Introduce a new `url-request-noninteractive' interface variable |
Date: |
Wed, 19 Nov 2014 15:25:56 +0000 |
branch: nsm
commit 838afa4ab55d1b5e40dd1cf8472dc71d581ce4cc
Author: Lars Magne Ingebrigtsen <address@hidden>
Date: Wed Nov 19 16:25:48 2014 +0100
Introduce a new `url-request-noninteractive' interface variable
* etc/NEWS: Mention `url-request-noninteractive'.
* lisp/url/url-http.el (url-http-noninteractive): New local variable.
(url-http): Set it locally.
* lisp/url/url-queue.el (url-queue-start-retrieve): Mark all we do as
noninteractive.
* lisp/url/url-vars.el (url-request-noninteractive): New interface variable.
---
etc/ChangeLog | 4 ++++
etc/NEWS | 4 ++++
lisp/url/ChangeLog | 10 ++++++++++
lisp/url/url-http.el | 5 +++++
lisp/url/url-queue.el | 9 +++++----
lisp/url/url-vars.el | 3 +++
6 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 851af7f..a3fc8c8 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-19 Lars Magne Ingebrigtsen <address@hidden>
+
+ * NEWS: Mention `url-request-noninteractive'.
+
2014-11-13 Paul Eggert <address@hidden>
Backport fix for minor Bazaar leftovers.
diff --git a/etc/NEWS b/etc/NEWS
index 3d580ee..13f75b7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1978,6 +1978,10 @@ and the `attributes' slot is always nil.
The `url-retrieve' function now uses this to encode its URL argument,
in case that is not properly encoded.
+*** New interface variable `url-request-noninteractive' can be used
+to specify that we're running in a noninteractive context, and that
+we should not be queried about things like TLS certificate validity.
+
** notifications.el supports now version 1.2 of the Notifications API.
The function `notifications-get-capabilities' returns the supported
server properties.
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index c2085a8..b4758f7 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,13 @@
+2014-11-19 Lars Magne Ingebrigtsen <address@hidden>
+
+ * url-queue.el (url-queue-start-retrieve): Mark all we do as
+ noninteractive.
+
+ * url-vars.el (url-request-noninteractive): New interface variable.
+
+ * url-http.el (url-http-noninteractive): New local variable.
+ (url-http): Set it locally.
+
2014-10-20 Glenn Morris <address@hidden>
* url-vars.el (url-bug-address): Make into an obsolete alias.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index d839d97..e37ab3f 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -39,6 +39,7 @@
(defvar url-http-data)
(defvar url-http-end-of-headers)
(defvar url-http-extra-headers)
+(defvar url-http-noninteractive)
(defvar url-http-method)
(defvar url-http-no-retry)
(defvar url-http-process)
@@ -1181,6 +1182,8 @@ previous `url-http' call, which is being re-attempted."
(cl-check-type url vector "Need a pre-parsed URL.")
(let* ((host (url-host (or url-using-proxy url)))
(port (url-port (or url-using-proxy url)))
+ (nsm-noninteractive (or url-request-noninteractive
+ url-http-noninteractive))
(connection (url-http-find-free-connection host port))
(buffer (or retry-buffer
(generate-new-buffer
@@ -1212,6 +1215,7 @@ previous `url-http' call, which is being re-attempted."
url-http-process
url-http-method
url-http-extra-headers
+ url-http-noninteractive
url-http-data
url-http-target-url
url-http-no-retry
@@ -1221,6 +1225,7 @@ previous `url-http' call, which is being re-attempted."
(setq url-http-method (or url-request-method "GET")
url-http-extra-headers url-request-extra-headers
+ url-http-noninteractive url-request-noninteractive
url-http-data url-request-data
url-http-process connection
url-http-chunked-length nil
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 87469b9..9c4b402 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."
(defun url-queue-start-retrieve (job)
(setf (url-queue-buffer job)
(ignore-errors
- (url-retrieve (url-queue-url job)
- #'url-queue-callback-function (list job)
- (url-queue-silentp job)
- (url-queue-inhibit-cookiesp job)))))
+ (let ((url-request-noninteractive t))
+ (url-retrieve (url-queue-url job)
+ #'url-queue-callback-function (list job)
+ (url-queue-silentp job)
+ (url-queue-inhibit-cookiesp job))))))
(defun url-queue-prune-old-entries ()
(let (dead-jobs)
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index 62b7b85..bc23b98 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -209,6 +209,9 @@ document."
"A list of extra headers to send with the next request.
Should be an assoc list of headers/contents.")
+(defvar url-request-noninteractive nil
+ "If non-nil, the request is done in a noninteractive context.")
+
(defvar url-request-method nil "The method to use for the next request.")
(defvar url-mime-encoding-string (and (fboundp 'zlib-available-p)