From: hmurata Date: Wed, 9 Aug 2006 08:53:19 +0000 (+0000) Subject: (elmo-folder-rename): Set meta data for global flags X-Git-Tag: wl-2_15_4~17 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=618babf5a027c7e12a2cff584c0480b601cb3442;p=elisp%2Fwanderlust.git (elmo-folder-rename): Set meta data for global flags follow the rename. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 67d8036..45e667d 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2006-08-09 Hiroya Murata + + * elmo.el (elmo-folder-rename): Set meta data for global flags + follow the rename. + 2006-07-03 Hiroya Murata * elmo-filter.el (elmo-folder-initialize): Set slot `number-list' diff --git a/elmo/elmo.el b/elmo/elmo.el index 5e9787a..044c1d6 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -785,18 +785,31 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-FLAG-ALIST).") t)) (luna-define-method elmo-folder-rename ((folder elmo-folder) new-name) - (let* ((new-folder (elmo-make-folder - new-name - nil - (elmo-folder-mime-charset-internal folder)))) + (let ((new-folder (elmo-make-folder + new-name + nil + (elmo-folder-mime-charset-internal folder)))) (unless (eq (elmo-folder-type-internal folder) (elmo-folder-type-internal new-folder)) (error "Not same folder type")) (when (or (file-exists-p (elmo-folder-msgdb-path new-folder)) (elmo-folder-exists-p new-folder)) (error "Already exists folder: %s" new-name)) - (elmo-folder-send folder 'elmo-folder-rename-internal new-folder) - (elmo-msgdb-rename-path folder new-folder))) + (let ((global-flag-entries + (mapcar (lambda (number) + (list number + (elmo-message-field folder number 'message-id) + (elmo-message-flags folder number))) + (elmo-folder-list-flagged folder 'digest 'in-msgdb)))) + (elmo-folder-send folder 'elmo-folder-rename-internal new-folder) + (elmo-msgdb-rename-path folder new-folder) + (dolist (entry global-flag-entries) + (let ((number (nth 0 entry)) + (message-id (nth 1 entry))) + (dolist (flag (nth 2 entry)) + (when (elmo-global-flag-p flag) + (elmo-global-flag-set flag new-folder number message-id) + (elmo-global-flag-detach flag folder number)))))))) (luna-define-method elmo-folder-delete-messages ((folder elmo-folder) numbers)