summaryrefslogtreecommitdiff
path: root/lisp/url/url-dav.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-04-12 04:03:16 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-04-12 04:03:16 +0000
commit0aa70d32499588297dfd8ee42963f8fd2b795cad (patch)
treeae5dbc54b29d270472d0afff1fedc702788363ba /lisp/url/url-dav.el
parent10c3c720ca922eed55746a29d3c5f1c5ef45f6b0 (diff)
downloademacs-0aa70d32499588297dfd8ee42963f8fd2b795cad.tar.gz
(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.
Diffstat (limited to 'lisp/url/url-dav.el')
-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 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
+;; DAV is in RFC 2518.
+
(eval-when-compile
(require 'cl))
@@ -31,12 +33,23 @@
(defvar url-dav-supported-protocols '(1 2)
"List of supported DAV versions.")
+(defun url-intersection (l1 l2)
+ "Return a list of the elements occuring in both of the lists L1 and L2."
+ (if (null l2)
+ l2
+ (let (result)
+ (while l1
+ (if (member (car l1) l2)
+ (setq result (cons (pop l1) result))
+ (pop l1)))
+ (nreverse result))))
+
;;;###autoload
(defun url-dav-supported-p (url)
(and (featurep 'xml)
(fboundp 'xml-expand-namespace)
- (intersection url-dav-supported-protocols
- (plist-get (url-http-options url) 'dav))))
+ (url-intersection url-dav-supported-protocols
+ (plist-get (url-http-options url) 'dav))))
(defun url-dav-node-text (node)
"Return the text data from the XML node NODE."
@@ -612,6 +625,8 @@ Returns `t' iff the lock was successfully released.
(url-debug 'dav "Unrecognized DAV:locktype (%S)" (car lock)))))
modes))
+(autoload 'url-http-head-file-attributes "url-http")
+
;;;###autoload
(defun url-dav-file-attributes (url)
(let ((properties (cdar (url-dav-get-properties url)))
@@ -673,6 +688,7 @@ Returns `t' iff the lock was successfully released.
"Save OBJ as URL using WebDAV.
URL must be a fully qualified URL.
OBJ may be a buffer or a string."
+ (declare (special url-http-response-status))
(let ((buffer nil)
(result nil)
(url-request-extra-headers nil)
@@ -860,7 +876,9 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
(defun url-dav-rename-file (oldname newname &optional overwrite)
(if (not (and (string-match url-handler-regexp oldname)
(string-match url-handler-regexp newname)))
- (signal 'file-error "Cannot rename between different URL backends" oldname newname))
+ (signal 'file-error
+ (list "Cannot rename between different URL backends"
+ oldname newname)))
(let* ((headers nil)
(props nil)