From 1400571ea88e7d1094c2ed232ec4a3002bf7c9f5 Mon Sep 17 00:00:00 2001 From: teranisi Date: Fri, 19 Sep 2003 12:50:33 +0000 Subject: [PATCH] * wl-summary.el (wl-summary-delete-all-msgs): Use elmo-folder-move-messages instead of elmo-folder-delete-messages and elmo-folder-detach-messages. * wl-expire.el (wl-expire-delete): Ditto. (wl-expire-refile-with-copy-reserve-msg): Ditto. * elmo.el (elmo-folder-delete-messages): Added notice in docstring. (elmo-folder-move-messages): Call elmo-global-flag-detach-messages with argument `delete-if-none' when dst-folder is 'null. * elmo-flag.el (elmo-folder-append-messages): Defined. (elmo-global-flag-detach-messages): Added argumnet `delete-if-none'. --- elmo/ChangeLog | 9 +++++++++ elmo/elmo-flag.el | 21 ++++++++++++++++++--- elmo/elmo.el | 7 +++++-- wl/ChangeLog | 9 +++++++++ wl/wl-expire.el | 6 ++---- wl/wl-summary.el | 4 ++-- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index abeaf85..a7cff0b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2003-09-19 Yuuichi Teranishi + + * elmo.el (elmo-folder-delete-messages): Added notice in docstring. + (elmo-folder-move-messages): Call elmo-global-flag-detach-messages + with argument `delete-if-none' when dst-folder is 'null. + + * elmo-flag.el (elmo-folder-append-messages): Defined. + (elmo-global-flag-detach-messages): Added argumnet `delete-if-none'. + 2003-09-18 Yuuichi Teranishi * elmo-flag.el (elmo-folder-initialize): Fixed ("/.minfo"->".minfo"). diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index cec895a..62590db 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -160,6 +160,18 @@ (message "Creating msgdb...done") new-msgdb))) +(luna-define-method elmo-folder-append-messages ((folder elmo-flag-folder) + src-folder + numbers + &optional same-number) + (dolist (number numbers) + (elmo-global-flag-set (elmo-flag-folder-flag-internal folder) + src-folder number (elmo-message-field + src-folder + number + 'message-id))) + numbers) + (luna-define-method elmo-folder-append-buffer ((folder elmo-flag-folder) unread &optional number) @@ -326,14 +338,17 @@ the message is not flagged in any folder." (elmo-localdir-delete-message flag-folder (nth 2 elem)) (elmo-folder-commit flag-folder))))))) -(defun elmo-global-flag-detach-messages (folder numbers) +(defun elmo-global-flag-detach-messages (folder numbers &optional + delete-if-none) "Detach all messages specified from all global flags. FOLDER is the folder structure. -NUMBERS is the message number list." +NUMBERS is the message number list. +If optional DELETE-IF-NONE is non-nil, delete message from flag folder when +the message is not flagged in any folder." (unless (eq (elmo-folder-type-internal folder) 'flag) (dolist (flag elmo-global-flag-list) (dolist (number numbers) - (elmo-global-flag-detach flag folder number))))) + (elmo-global-flag-detach flag folder number delete-if-none))))) ;;; To migrate from global mark folder (defvar elmo-global-mark-filename "global-mark" diff --git a/elmo/elmo.el b/elmo/elmo.el index 27751ef..81c9ade 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -308,7 +308,9 @@ Otherwise, all descendent folders are returned.") (luna-define-generic elmo-folder-delete-messages (folder numbers) "Delete messages. FOLDER is the ELMO folder structure. -NUMBERS is a list of message numbers to be deleted.") +NUMBERS is a list of message numbers to be deleted. +It is not recommended to use this function other than internal use. +Use `elmo-folder-move-messages' with dst-folder 'null instead.") (luna-define-generic elmo-folder-search (folder condition &optional numbers) "Search and return list of message numbers. @@ -1069,7 +1071,8 @@ NUMBERS is a list of message numbers, messages are searched from the list." (if (and (elmo-folder-delete-messages src-folder succeeds) (elmo-folder-detach-messages src-folder succeeds)) (progn - (elmo-global-flag-detach-messages src-folder succeeds) + (elmo-global-flag-detach-messages + src-folder succeeds (eq dst-folder 'null)) (setq result t)) (message "move: delete messages from %s failed." (elmo-folder-name-internal src-folder)) diff --git a/wl/ChangeLog b/wl/ChangeLog index e95a217..32b02ed 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,12 @@ +2003-09-19 Yuuichi Teranishi + + * wl-summary.el (wl-summary-delete-all-msgs): Use + elmo-folder-move-messages instead of elmo-folder-delete-messages + and elmo-folder-detach-messages. + + * wl-expire.el (wl-expire-delete): Ditto. + (wl-expire-refile-with-copy-reserve-msg): Ditto. + 2003-09-18 Yuuichi Teranishi * wl-vars.el (wl-message-use-header-narrowing): New user option. diff --git a/wl/wl-expire.el b/wl/wl-expire.el index 79e7038..a452149 100644 --- a/wl/wl-expire.el +++ b/wl/wl-expire.el @@ -125,9 +125,8 @@ (format "Expiring (delete) %s msgs..." (length delete-list)))) (message "%s" mess) - (if (elmo-folder-delete-messages folder delete-list) + (if (elmo-folder-move-messages folder delete-list 'null) (progn - (elmo-folder-detach-messages folder delete-list) (wl-expire-append-log (elmo-folder-name-internal folder) delete-list nil 'delete) @@ -224,9 +223,8 @@ If REFILE-LIST includes reserve mark message, so copy." (wl-expire-delete-reserved-messages refile-list folder)) (when refile-list (if (setq ret-val - (elmo-folder-delete-messages folder refile-list)) + (elmo-folder-move-messages folder refile-list 'null)) (progn - (elmo-folder-detach-messages folder refile-list) (wl-expire-append-log (elmo-folder-name-internal folder) refile-list nil 'delete)))))) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 12f9523..6c3f1bc 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -1958,8 +1958,8 @@ If ARG is non-nil, checking is omitted." (length dels))) (progn (message "Deleting...") - (elmo-folder-delete-messages wl-summary-buffer-elmo-folder dels) - (elmo-folder-detach-messages wl-summary-buffer-elmo-folder dels) + (elmo-folder-move-messages wl-summary-buffer-elmo-folder dels + 'null) (wl-summary-set-message-modified) (wl-folder-set-folder-updated (wl-summary-buffer-folder-name) (list 0 0 0)) -- 1.7.10.4