aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-04-12 04:03:16 +0000
committerStefan Monnier2004-04-12 04:03:16 +0000
commit0aa70d32499588297dfd8ee42963f8fd2b795cad (patch)
treeae5dbc54b29d270472d0afff1fedc702788363ba
parent10c3c720ca922eed55746a29d3c5f1c5ef45f6b0 (diff)
downloademacs-0aa70d32499588297dfd8ee42963f8fd2b795cad.tar.gz
emacs-0aa70d32499588297dfd8ee42963f8fd2b795cad.zip
(url-dav-rename-file): Fix args of `signal'.
(url-intersection): New. (url-dav-supported-p): Use it. (url-dav-save-resource): Declare url-http-response-status special.
-rw-r--r--lisp/url/url-dav.el24
1 files changed, 21 insertions, 3 deletions
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index 4e744b3da76..a35cb2a2bc6 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -21,6 +21,8 @@
21;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22;; Boston, MA 02111-1307, USA. 22;; Boston, MA 02111-1307, USA.
23 23
24;; DAV is in RFC 2518.
25
24(eval-when-compile 26(eval-when-compile
25 (require 'cl)) 27 (require 'cl))
26 28
@@ -31,12 +33,23 @@
31(defvar url-dav-supported-protocols '(1 2) 33(defvar url-dav-supported-protocols '(1 2)
32 "List of supported DAV versions.") 34 "List of supported DAV versions.")
33 35
36(defun url-intersection (l1 l2)
37 "Return a list of the elements occuring in both of the lists L1 and L2."
38 (if (null l2)
39 l2
40 (let (result)
41 (while l1
42 (if (member (car l1) l2)
43 (setq result (cons (pop l1) result))
44 (pop l1)))
45 (nreverse result))))
46
34;;;###autoload 47;;;###autoload
35(defun url-dav-supported-p (url) 48(defun url-dav-supported-p (url)
36 (and (featurep 'xml) 49 (and (featurep 'xml)
37 (fboundp 'xml-expand-namespace) 50 (fboundp 'xml-expand-namespace)
38 (intersection url-dav-supported-protocols 51 (url-intersection url-dav-supported-protocols
39 (plist-get (url-http-options url) 'dav)))) 52 (plist-get (url-http-options url) 'dav))))
40 53
41(defun url-dav-node-text (node) 54(defun url-dav-node-text (node)
42 "Return the text data from the XML node NODE." 55 "Return the text data from the XML node NODE."
@@ -612,6 +625,8 @@ Returns `t' iff the lock was successfully released.
612 (url-debug 'dav "Unrecognized DAV:locktype (%S)" (car lock))))) 625 (url-debug 'dav "Unrecognized DAV:locktype (%S)" (car lock)))))
613 modes)) 626 modes))
614 627
628(autoload 'url-http-head-file-attributes "url-http")
629
615;;;###autoload 630;;;###autoload
616(defun url-dav-file-attributes (url) 631(defun url-dav-file-attributes (url)
617 (let ((properties (cdar (url-dav-get-properties url))) 632 (let ((properties (cdar (url-dav-get-properties url)))
@@ -673,6 +688,7 @@ Returns `t' iff the lock was successfully released.
673 "Save OBJ as URL using WebDAV. 688 "Save OBJ as URL using WebDAV.
674URL must be a fully qualified URL. 689URL must be a fully qualified URL.
675OBJ may be a buffer or a string." 690OBJ may be a buffer or a string."
691 (declare (special url-http-response-status))
676 (let ((buffer nil) 692 (let ((buffer nil)
677 (result nil) 693 (result nil)
678 (url-request-extra-headers nil) 694 (url-request-extra-headers nil)
@@ -860,7 +876,9 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
860(defun url-dav-rename-file (oldname newname &optional overwrite) 876(defun url-dav-rename-file (oldname newname &optional overwrite)
861 (if (not (and (string-match url-handler-regexp oldname) 877 (if (not (and (string-match url-handler-regexp oldname)
862 (string-match url-handler-regexp newname))) 878 (string-match url-handler-regexp newname)))
863 (signal 'file-error "Cannot rename between different URL backends" oldname newname)) 879 (signal 'file-error
880 (list "Cannot rename between different URL backends"
881 oldname newname)))
864 882
865 (let* ((headers nil) 883 (let* ((headers nil)
866 (props nil) 884 (props nil)