summaryrefslogtreecommitdiff
path: root/lisp/url/url-dav.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-04-16 21:58:11 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-04-16 21:58:11 +0000
commitf1bfaf653bfc33aa1a7fa8a8f026b1bc6206c9ea (patch)
treeec1c52b9d1aa831bc64893ce900de862c62cbf3f /lisp/url/url-dav.el
parent996884b257d62b98d3e4438848a510e19eaf021a (diff)
downloademacs-f1bfaf653bfc33aa1a7fa8a8f026b1bc6206c9ea.tar.gz
Use with-current-buffer.
(url-dav-process-response): Fix regexps and spurious quote. (url-dav-file-attributes): Add id-format param.
Diffstat (limited to 'lisp/url/url-dav.el')
-rw-r--r--lisp/url/url-dav.el27
1 files changed, 11 insertions, 16 deletions
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index b54d9f52c01..d6c5ffffa43 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -386,8 +386,7 @@ XML document."
(overall-status nil))
(when buffer
(unwind-protect
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(goto-char url-http-end-of-headers)
(setq overall-status url-http-response-status)
@@ -396,13 +395,13 @@ XML document."
;; them.
(if (and
url-http-content-type
- (or (string-match "^text/xml" url-http-content-type)
- (string-match "^application/xml" url-http-content-type)))
+ (string-match "\\`\\(text\\|application\\)/xml"
+ url-http-content-type))
(setq tree (xml-parse-region (point) (point-max)))))
;; Clean up after ourselves.
- '(kill-buffer buffer)))
+ (kill-buffer buffer)))
- ;; We should now be
+ ;; We should now be
(if (eq (xml-node-name (car tree)) 'DAV:multistatus)
(url-dav-dispatch-node (car tree))
(url-debug 'dav "Got back singleton response for URL(%S)" url)
@@ -577,8 +576,7 @@ Returns t iff the lock was successfully released."
(result nil))
(when buffer
(unwind-protect
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq result (url-dav-http-success-p url-http-response-status)))
(kill-buffer buffer)))
result))
@@ -627,7 +625,7 @@ Returns t iff the lock was successfully released."
(autoload 'url-http-head-file-attributes "url-http")
;;;###autoload
-(defun url-dav-file-attributes (url)
+(defun url-dav-file-attributes (url &optional id-format)
(let ((properties (cdar (url-dav-get-properties url)))
(attributes nil))
(if (and properties
@@ -679,7 +677,7 @@ Returns t iff the lock was successfully released."
;; device number - meaningless
nil))
;; Fall back to just the normal http way of doing things.
- (setq attributes (url-http-head-file-attributes url)))
+ (setq attributes (url-http-head-file-attributes url id-format)))
attributes))
;;;###autoload
@@ -695,8 +693,7 @@ OBJ may be a buffer or a string."
(url-request-data
(cond
((bufferp obj)
- (save-excursion
- (set-buffer obj)
+ (with-current-buffer obj
(buffer-string)))
((stringp obj)
obj)
@@ -719,8 +716,7 @@ OBJ may be a buffer or a string."
;; Sanity checking
(when buffer
(unwind-protect
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq result (url-dav-http-success-p url-http-response-status)))
(kill-buffer buffer)))
result))
@@ -849,8 +845,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
(result nil))
(when buffer
(unwind-protect
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(case url-http-response-status
(201 ; Collection created in its entirety
(setq result t))