From: yoichi Date: Mon, 10 Feb 2003 06:01:49 +0000 (+0000) Subject: * elmo-maildir.el (elmo-folder-rename-internal): New method, X-Git-Tag: wl-2_11_3~11 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb3c168e69d05541fc34309eaf10cb2a382b0c75;p=elisp%2Fwanderlust.git * elmo-maildir.el (elmo-folder-rename-internal): New method, copied from localdir's one. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 5a85509..4f0241b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,8 @@ 2003-02-10 Yoichi NAKAYAMA + * elmo-maildir.el (elmo-folder-rename-internal): New method, + copied from localdir's one. + * elmo-pipe.el (elmo-folder-rename): New method, rename destination folder with leaving source folder as it is. diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 6fe8c22..0cf693c 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -482,6 +482,20 @@ file name for maildir directories." t) (error nil)))) +(luna-define-method elmo-folder-rename-internal ((folder elmo-maildir-folder) + new-folder) + (let* ((old (elmo-maildir-folder-directory-internal folder)) + (new (elmo-maildir-folder-directory-internal new-folder)) + (new-dir (directory-file-name (file-name-directory new)))) + (unless (file-directory-p old) + (error "No such directory: %s" old)) + (when (file-exists-p new) + (error "Already exists directory: %s" new)) + (unless (file-directory-p new-dir) + (elmo-make-directory new-dir)) + (rename-file old new) + t)) + (require 'product) (product-provide (provide 'elmo-maildir) (require 'elmo-version))