summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2009-10-01 15:40:59 +0000
committerMichael Albinus <michael.albinus@gmx.de>2009-10-01 15:40:59 +0000
commitcc3dda16b935c45d482bb3a9797c70627ab17696 (patch)
treef02a083752f58e12920333782bbbe1be8a47bbe1
parent93776a8c4a41889218bba1e270504590f303a1d4 (diff)
downloademacs-cc3dda16b935c45d482bb3a9797c70627ab17696.tar.gz
* net/tramp-smb.el (tramp-smb-errors): Add error message for
connection timeout. (tramp-smb-handle-delete-directory): Handle optional parameter RECURSIVE.
-rw-r--r--lisp/ChangeLog29
-rw-r--r--lisp/net/tramp-smb.el12
2 files changed, 40 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9e87539ab69..3bfd9c70ff4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,32 @@
+2009-10-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * files.el (delete-directory): New defun. The original function
+ in fileio.c has been renamed to `delete-directory-internal'.
+
+ * dired.el (dired-delete-file): Call `delete-directory' with
+ RECURSIVE parameter.
+
+ * net/ange-ftp.el (ange-ftp-delete-directory ): Add optional
+ parameter RECURSIVE. Implementation is missing.
+
+ * net/tramp.el (tramp-handle-make-directory): Flush upper
+ directory's file properties.
+ (tramp-handle-delete-directory): Handle optional parameter
+ RECURSIVE.
+ (tramp-handle-dired-recursive-delete-directory): Flush directory
+ properties after the remove command only.
+
+ * net/tramp-fish.el (tramp-fish-handle-delete-directory): Handle
+ optional parameter RECURSIVE.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Handle
+ optional parameter RECURSIVE.
+
+ * net/tramp-smb.el (tramp-smb-errors): Add error message for
+ connection timeout.
+ (tramp-smb-handle-delete-directory): Handle optional parameter
+ RECURSIVE.
+
2009-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-defmacro-declaration): New fun.
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 549001db75a..54835efe226 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -87,6 +87,7 @@
"NT_STATUS_ACCOUNT_LOCKED_OUT"
"NT_STATUS_BAD_NETWORK_NAME"
"NT_STATUS_CANNOT_DELETE"
+ "NT_STATUS_CONNECTION_REFUSED"
"NT_STATUS_DIRECTORY_NOT_EMPTY"
"NT_STATUS_DUPLICATE_NAME"
"NT_STATUS_FILE_IS_A_DIRECTORY"
@@ -248,10 +249,19 @@ PRESERVE-UID-GID is completely ignored."
v 0 "Copying file %s to file %s...done" filename newname)
(tramp-error v 'file-error "Cannot copy `%s'" filename)))))))
-(defun tramp-smb-handle-delete-directory (directory)
+(defun tramp-smb-handle-delete-directory (directory &optional recursive)
"Like `delete-directory' for Tramp files."
(setq directory (directory-file-name (expand-file-name directory)))
(when (file-exists-p directory)
+ (if recursive
+ (mapc
+ (lambda (file)
+ (if (file-directory-p file)
+ (delete-directory file recursive)
+ (delete-file file)))
+ ;; We do not want to delete "." and "..".
+ (directory-files
+ directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
(with-parsed-tramp-file-name directory nil
;; We must also flush the cache of the directory, because
;; file-attributes reads the values from there.