aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Brinkhoff2017-03-21 20:48:52 +0100
committerLars Brinkhoff2017-04-04 08:23:46 +0200
commitb6738682ae16c71132c95cd87d48daf598fe89a9 (patch)
tree114230b8a5c52886be1741e7e2062b7def9cba61
parent8e6f204f44b6183ba73c7d1bec5841f2b7b8bdd0 (diff)
downloademacs-b6738682ae16c71132c95cd87d48daf598fe89a9.tar.gz
emacs-b6738682ae16c71132c95cd87d48daf598fe89a9.zip
Make the URL library use records.
* lisp/url/url.el, lisp/url/url-cache.el, lisp/url/url-dav.el, lisp/url/url-expand.el, lisp/url/url-file.el, lisp/url/url-imap.el, lisp/url/url-ldap.el: Use `url-p' instead of `vectorp'. * lisp/url/url-http.el (url-http): Check for type `url' instead of `vector'.
-rw-r--r--lisp/url/url-cache.el2
-rw-r--r--lisp/url/url-dav.el4
-rw-r--r--lisp/url/url-expand.el2
-rw-r--r--lisp/url/url-file.el2
-rw-r--r--lisp/url/url-http.el2
-rw-r--r--lisp/url/url-imap.el2
-rw-r--r--lisp/url/url-ldap.el4
-rw-r--r--lisp/url/url.el2
8 files changed, 10 insertions, 10 deletions
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 192bbb2481f..a7247dfe10a 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -184,7 +184,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise."
184 ;; if it has been specified: e.g. http://www.example.com:80 will 184 ;; if it has been specified: e.g. http://www.example.com:80 will
185 ;; be transcoded as http://www.example.com 185 ;; be transcoded as http://www.example.com
186 (url-recreate-url 186 (url-recreate-url
187 (if (vectorp url) url 187 (if (url-p url) url
188 (url-generic-parse-url url))))) 188 (url-generic-parse-url url)))))
189 189
190;;;###autoload 190;;;###autoload
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index f47bc5da3e4..59b836ca6d1 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -518,7 +518,7 @@ FAILURE-RESULTS is a list of (URL STATUS)."
518 depth '(("Timeout" . "Infinite")))) 518 depth '(("Timeout" . "Infinite"))))
519 519
520 ;; Get the parent URL ready for expand-file-name 520 ;; Get the parent URL ready for expand-file-name
521 (if (not (vectorp url)) 521 (if (not (url-p url))
522 (setq url (url-generic-parse-url url))) 522 (setq url (url-generic-parse-url url)))
523 523
524 ;; Walk thru the response list, fully expand the URL, and grab the 524 ;; Walk thru the response list, fully expand the URL, and grab the
@@ -540,7 +540,7 @@ FAILURE-RESULTS is a list of (URL STATUS)."
540 (child-url nil) 540 (child-url nil)
541 (child-results nil) 541 (child-results nil)
542 (results nil)) 542 (results nil))
543 (if (not (vectorp url)) 543 (if (not (url-p url))
544 (setq url (url-generic-parse-url url))) 544 (setq url (url-generic-parse-url url)))
545 545
546 (while response 546 (while response
diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el
index cc9341bdf5f..9ceaa025fb3 100644
--- a/lisp/url/url-expand.el
+++ b/lisp/url/url-expand.el
@@ -73,7 +73,7 @@ path components followed by `..' are removed, along with the `..' itself."
73 73
74 ;; Need to figure out how/where to expand the fragment relative to 74 ;; Need to figure out how/where to expand the fragment relative to
75 (setq default (cond 75 (setq default (cond
76 ((vectorp default) 76 ((url-p default)
77 ;; Default URL has already been parsed 77 ;; Default URL has already been parsed
78 default) 78 default)
79 (default 79 (default
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index 8e63a9073e3..1dda1d3325d 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -89,7 +89,7 @@ to them."
89 keep-date &optional msg cont nowait)) 89 keep-date &optional msg cont nowait))
90 90
91(defun url-file-build-filename (url) 91(defun url-file-build-filename (url)
92 (if (not (vectorp url)) 92 (if (not (url-p url))
93 (setq url (url-generic-parse-url url))) 93 (setq url (url-generic-parse-url url)))
94 (let* ((user (url-user url)) 94 (let* ((user (url-user url))
95 (pass (url-password url)) 95 (pass (url-password url))
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 90f2e59cc5b..06d32861b2e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1243,7 +1243,7 @@ Optional arg GATEWAY-METHOD specifies the gateway to be used,
1243overriding the value of `url-gateway-method'. 1243overriding the value of `url-gateway-method'.
1244 1244
1245The return value of this function is the retrieval buffer." 1245The return value of this function is the retrieval buffer."
1246 (cl-check-type url vector "Need a pre-parsed URL.") 1246 (cl-check-type url url "Need a pre-parsed URL.")
1247 (let* (;; (host (url-host (or url-using-proxy url))) 1247 (let* (;; (host (url-host (or url-using-proxy url)))
1248 ;; (port (url-port (or url-using-proxy url))) 1248 ;; (port (url-port (or url-using-proxy url)))
1249 (nsm-noninteractive (or url-request-noninteractive 1249 (nsm-noninteractive (or url-request-noninteractive
diff --git a/lisp/url/url-imap.el b/lisp/url/url-imap.el
index 1195a344c90..b8fe4ed5ff7 100644
--- a/lisp/url/url-imap.el
+++ b/lisp/url/url-imap.el
@@ -50,7 +50,7 @@
50 (nnimap-authenticator ,authenticator))))) 50 (nnimap-authenticator ,authenticator)))))
51 51
52(defun url-imap (url) 52(defun url-imap (url)
53 (unless (vectorp url) 53 (unless (url-p url)
54 (signal 'wrong-type-error (list "Need a pre-parsed URL." url))) 54 (signal 'wrong-type-error (list "Need a pre-parsed URL." url)))
55 (with-current-buffer (generate-new-buffer " *url-imap*") 55 (with-current-buffer (generate-new-buffer " *url-imap*")
56 (mm-disable-multibyte) 56 (mm-disable-multibyte)
diff --git a/lisp/url/url-ldap.el b/lisp/url/url-ldap.el
index 8f5f6f55d0a..d9a18e554fa 100644
--- a/lisp/url/url-ldap.el
+++ b/lisp/url/url-ldap.el
@@ -115,11 +115,11 @@
115(defun url-ldap (url) 115(defun url-ldap (url)
116 "Perform an LDAP search specified by URL. 116 "Perform an LDAP search specified by URL.
117The return value is a buffer displaying the search results in HTML. 117The return value is a buffer displaying the search results in HTML.
118URL can be a URL string, or a URL vector of the type returned by 118URL can be a URL string, or a URL record of the type returned by
119`url-generic-parse-url'." 119`url-generic-parse-url'."
120 (if (stringp url) 120 (if (stringp url)
121 (setq url (url-generic-parse-url (url-unhex-string url))) 121 (setq url (url-generic-parse-url (url-unhex-string url)))
122 (if (not (vectorp url)) 122 (if (not (url-p url))
123 (error "Argument is not a valid URL"))) 123 (error "Argument is not a valid URL")))
124 (with-current-buffer (generate-new-buffer " *url-ldap*") 124 (with-current-buffer (generate-new-buffer " *url-ldap*")
125 (setq url-current-object url) 125 (setq url-current-object url)
diff --git a/lisp/url/url.el b/lisp/url/url.el
index 2eec1c44def..75cf77deaa4 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -186,7 +186,7 @@ URL-encoded before it's used."
186 (when (stringp url) 186 (when (stringp url)
187 (set-text-properties 0 (length url) nil url) 187 (set-text-properties 0 (length url) nil url)
188 (setq url (url-encode-url url))) 188 (setq url (url-encode-url url)))
189 (if (not (vectorp url)) 189 (if (not (url-p url))
190 (setq url (url-generic-parse-url url))) 190 (setq url (url-generic-parse-url url)))
191 (if (not (functionp callback)) 191 (if (not (functionp callback))
192 (error "Must provide a callback function to url-retrieve")) 192 (error "Must provide a callback function to url-retrieve"))