From cb3c168e69d05541fc34309eaf10cb2a382b0c75 Mon Sep 17 00:00:00 2001 From: yoichi Date: Mon, 10 Feb 2003 06:01:49 +0000 Subject: [PATCH] * elmo-maildir.el (elmo-folder-rename-internal): New method, copied from localdir's one. --- elmo/ChangeLog | 3 +++ elmo/elmo-maildir.el | 14 ++++++++++++++ 2 files changed, 17 insertions(+) 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)) -- 1.7.10.4