From: yoichi Date: Mon, 10 Feb 2003 04:24:28 +0000 (+0000) Subject: * elmo-pipe.el (elmo-folder-rename): New method, rename X-Git-Tag: wl-2_11_3~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53b3db05e3ec8a9f83e727dcfdc4c789246a7c5;p=elisp%2Fwanderlust.git * elmo-pipe.el (elmo-folder-rename): New method, rename destination folder with leaving source folder as it is. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 9a8ef21..5a85509 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2003-02-10 Yoichi NAKAYAMA + + * elmo-pipe.el (elmo-folder-rename): New method, rename + destination folder with leaving source folder as it is. + 2003-02-08 KAMO Tomoyuki * elmo-nntp.el (elmo-nntp-get-folders-info): Don't use diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index e2dfc04..c4194b7 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -304,6 +304,28 @@ (luna-define-method elmo-folder-pack-numbers ((folder elmo-pipe-folder)) (elmo-folder-pack-numbers (elmo-pipe-folder-dst-internal folder))) +(luna-define-method elmo-folder-rename ((folder elmo-pipe-folder) new-name) + (let* ((new-folder (elmo-make-folder new-name))) + (unless (string= (elmo-folder-name-internal + (elmo-pipe-folder-src-internal folder)) + (elmo-folder-name-internal + (elmo-pipe-folder-src-internal new-folder))) + (error "Source folder differ")) + (unless (eq (elmo-folder-type-internal + (elmo-pipe-folder-dst-internal folder)) + (elmo-folder-type-internal + (elmo-pipe-folder-dst-internal new-folder))) + (error "Not same folder type")) + (if (or (file-exists-p (elmo-folder-msgdb-path + (elmo-pipe-folder-dst-internal new-folder))) + (elmo-folder-exists-p + (elmo-pipe-folder-dst-internal new-folder))) + (error "Already exists folder: %s" new-name)) + (elmo-folder-send (elmo-pipe-folder-dst-internal folder) + 'elmo-folder-rename-internal + (elmo-pipe-folder-dst-internal new-folder)) + (elmo-msgdb-rename-path folder new-folder))) + (require 'product) (product-provide (provide 'elmo-pipe) (require 'elmo-version))