X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/b17f53abc28496125965f36147b76ea5f6a2b4fb..acaf905b1130aae80fa59d2c861ffd4c8eb75486:/lisp/url/url-dav.el diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index fafea4c1f0..03527bceee 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el @@ -1,6 +1,6 @@ ;;; url-dav.el --- WebDAV support -;; Copyright (C) 2001, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2004-2012 Free Software Foundation, Inc. ;; Author: Bill Perry ;; Maintainer: Bill Perry @@ -8,10 +8,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,9 +19,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;; DAV is in RFC 2518. @@ -40,7 +38,7 @@ "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." + "Return a list of the elements occurring in both of the lists L1 and L2." (if (null l2) l2 (let (result) @@ -102,7 +100,7 @@ (list (concat "^" full-date) (concat "T" partial-time) (concat "Z" time-numoffset))) - "List of regular expressions matching iso8601 dates. + "List of regular expressions matching ISO 8601 dates. 1st regular expression matches the date. 2nd regular expression matches the time. 3rd regular expression matches the (optional) timezone specification.") @@ -119,7 +117,7 @@ ;; We need to populate 'time' with ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) - ;; Nobody else handles iso8601 correctly, lets do it ourselves. + ;; Nobody else handles iso8601 correctly, let's do it ourselves. (when (string-match date-re date-string re-start) (setq year (string-to-number (match-string 1 date-string)) month (string-to-number (match-string 2 date-string)) @@ -419,7 +417,7 @@ XML document." Automatically creates an XML request body if TAG is non-nil. BODY is the XML document fragment to be enclosed by . -DEPTH is how deep the request should propogate. Default is 0, meaning +DEPTH is how deep the request should propagate. Default is 0, meaning it should apply only to URL. A negative number means to use `Infinity' for the depth. Not all WebDAV servers support this depth though. @@ -432,7 +430,7 @@ added to this list, so most requests can just pass in nil." ;; Take care of the default value for depth... (setq depth (or depth 0)) - ;; Now lets translate it into something webdav can understand. + ;; Now let's translate it into something webdav can understand. (if (< depth 0) (setq depth "Infinity") (setq depth (int-to-string depth))) @@ -474,7 +472,7 @@ names (ie: DAV:resourcetype)." depth nil namespaces)) (defmacro url-dav-http-success-p (status) - "Return whether PROPERTIES was the result of a successful DAV request." + "Return whether STATUS was the result of a successful DAV request." `(= (/ (or ,status 500) 100) 2)) @@ -716,8 +714,7 @@ OBJ may be a buffer or a string." (defmacro url-dav-delete-something (url lock-token &rest error-checking) "Delete URL completely, with no sanity checking whatsoever. DO NOT USE. This is defined as a macro that will not be visible from compiled files. -Use with care, and even then think three times. -" +Use with care, and even then think three times." `(progn ,@error-checking (url-dav-request ,url "DELETE" nil nil -1 @@ -765,13 +762,13 @@ files in the collection as well." (setq status (plist-get (cdr result) 'DAV:status)) (if (not (url-dav-http-success-p status)) (signal 'file-error (list "Removing old name" - "Errror removing" + "Error removing" (car result) status)))) props)) nil) (defun url-dav-directory-files (url &optional full match nosort files-only) - "Return a list of names of files in DIRECTORY. + "Return a list of names of files in URL. There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. @@ -891,16 +888,16 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. t)) (defun url-dav-file-name-all-completions (file url) - "Return a list of all completions of file name FILE in directory DIRECTORY. -These are all file names in directory DIRECTORY which begin with FILE." + "Return a list of all completions of file name FILE in URL. +These are all file names in URL which begin with FILE." (url-dav-directory-files url nil (concat "^" file ".*"))) (defun url-dav-file-name-completion (file url) - "Complete file name FILE in directory DIRECTORY. -Returns the longest string -common to all file names in DIRECTORY that start with FILE. + "Complete file name FILE in URL. +Returns the longest string common to all file names in URL +that start with FILE. If there is only one and FILE matches it exactly, returns t. -Returns nil if DIR contains no name starting with FILE." +Returns nil if URL contains no name starting with FILE." (let ((matches (url-dav-file-name-all-completions file url)) (result nil)) (cond @@ -912,7 +909,7 @@ Returns nil if DIR contains no name starting with FILE." ;; Only one file and FILE matches it exactly... t) (t - ;; Need to figure out the longest string that they have in commmon + ;; Need to figure out the longest string that they have in common (setq matches (sort matches (lambda (a b) (> (length a) (length b))))) (let ((n (length file)) (searching t) @@ -965,5 +962,4 @@ Returns nil if DIR contains no name starting with FILE." (provide 'url-dav) -;; arch-tag: 2b14b7b3-888a-49b8-a490-17276a40e78e ;;; url-dav.el ends here