aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2004-04-16 21:58:11 +0000
committerStefan Monnier2004-04-16 21:58:11 +0000
commitf1bfaf653bfc33aa1a7fa8a8f026b1bc6206c9ea (patch)
treeec1c52b9d1aa831bc64893ce900de862c62cbf3f /lisp
parent996884b257d62b98d3e4438848a510e19eaf021a (diff)
downloademacs-f1bfaf653bfc33aa1a7fa8a8f026b1bc6206c9ea.tar.gz
emacs-f1bfaf653bfc33aa1a7fa8a8f026b1bc6206c9ea.zip
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')
-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."
386 (overall-status nil)) 386 (overall-status nil))
387 (when buffer 387 (when buffer
388 (unwind-protect 388 (unwind-protect
389 (save-excursion 389 (with-current-buffer buffer
390 (set-buffer buffer)
391 (goto-char url-http-end-of-headers) 390 (goto-char url-http-end-of-headers)
392 (setq overall-status url-http-response-status) 391 (setq overall-status url-http-response-status)
393 392
@@ -396,13 +395,13 @@ XML document."
396 ;; them. 395 ;; them.
397 (if (and 396 (if (and
398 url-http-content-type 397 url-http-content-type
399 (or (string-match "^text/xml" url-http-content-type) 398 (string-match "\\`\\(text\\|application\\)/xml"
400 (string-match "^application/xml" url-http-content-type))) 399 url-http-content-type))
401 (setq tree (xml-parse-region (point) (point-max))))) 400 (setq tree (xml-parse-region (point) (point-max)))))
402 ;; Clean up after ourselves. 401 ;; Clean up after ourselves.
403 '(kill-buffer buffer))) 402 (kill-buffer buffer)))
404 403
405 ;; We should now be 404 ;; We should now be
406 (if (eq (xml-node-name (car tree)) 'DAV:multistatus) 405 (if (eq (xml-node-name (car tree)) 'DAV:multistatus)
407 (url-dav-dispatch-node (car tree)) 406 (url-dav-dispatch-node (car tree))
408 (url-debug 'dav "Got back singleton response for URL(%S)" url) 407 (url-debug 'dav "Got back singleton response for URL(%S)" url)
@@ -577,8 +576,7 @@ Returns t iff the lock was successfully released."
577 (result nil)) 576 (result nil))
578 (when buffer 577 (when buffer
579 (unwind-protect 578 (unwind-protect
580 (save-excursion 579 (with-current-buffer buffer
581 (set-buffer buffer)
582 (setq result (url-dav-http-success-p url-http-response-status))) 580 (setq result (url-dav-http-success-p url-http-response-status)))
583 (kill-buffer buffer))) 581 (kill-buffer buffer)))
584 result)) 582 result))
@@ -627,7 +625,7 @@ Returns t iff the lock was successfully released."
627(autoload 'url-http-head-file-attributes "url-http") 625(autoload 'url-http-head-file-attributes "url-http")
628 626
629;;;###autoload 627;;;###autoload
630(defun url-dav-file-attributes (url) 628(defun url-dav-file-attributes (url &optional id-format)
631 (let ((properties (cdar (url-dav-get-properties url))) 629 (let ((properties (cdar (url-dav-get-properties url)))
632 (attributes nil)) 630 (attributes nil))
633 (if (and properties 631 (if (and properties
@@ -679,7 +677,7 @@ Returns t iff the lock was successfully released."
679 ;; device number - meaningless 677 ;; device number - meaningless
680 nil)) 678 nil))
681 ;; Fall back to just the normal http way of doing things. 679 ;; Fall back to just the normal http way of doing things.
682 (setq attributes (url-http-head-file-attributes url))) 680 (setq attributes (url-http-head-file-attributes url id-format)))
683 attributes)) 681 attributes))
684 682
685;;;###autoload 683;;;###autoload
@@ -695,8 +693,7 @@ OBJ may be a buffer or a string."
695 (url-request-data 693 (url-request-data
696 (cond 694 (cond
697 ((bufferp obj) 695 ((bufferp obj)
698 (save-excursion 696 (with-current-buffer obj
699 (set-buffer obj)
700 (buffer-string))) 697 (buffer-string)))
701 ((stringp obj) 698 ((stringp obj)
702 obj) 699 obj)
@@ -719,8 +716,7 @@ OBJ may be a buffer or a string."
719 ;; Sanity checking 716 ;; Sanity checking
720 (when buffer 717 (when buffer
721 (unwind-protect 718 (unwind-protect
722 (save-excursion 719 (with-current-buffer buffer
723 (set-buffer buffer)
724 (setq result (url-dav-http-success-p url-http-response-status))) 720 (setq result (url-dav-http-success-p url-http-response-status)))
725 (kill-buffer buffer))) 721 (kill-buffer buffer)))
726 result)) 722 result))
@@ -849,8 +845,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
849 (result nil)) 845 (result nil))
850 (when buffer 846 (when buffer
851 (unwind-protect 847 (unwind-protect
852 (save-excursion 848 (with-current-buffer buffer
853 (set-buffer buffer)
854 (case url-http-response-status 849 (case url-http-response-status
855 (201 ; Collection created in its entirety 850 (201 ; Collection created in its entirety
856 (setq result t)) 851 (setq result t))