* wl-summary.el (wl-summary-delete-all-msgs): Use
authorteranisi <teranisi>
Fri, 19 Sep 2003 12:50:33 +0000 (12:50 +0000)
committerteranisi <teranisi>
Fri, 19 Sep 2003 12:50:33 +0000 (12:50 +0000)
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
elmo/elmo-flag.el
elmo/elmo.el
wl/ChangeLog
wl/wl-expire.el
wl/wl-summary.el

index abeaf85..a7cff0b 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * 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  <teranisi@gohome.org>
 
        * elmo-flag.el (elmo-folder-initialize): Fixed ("/.minfo"->".minfo").
index cec895a..62590db 100644 (file)
       (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"
index 27751ef..81c9ade 100644 (file)
@@ -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))
index e95a217..32b02ed 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * 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  <teranisi@gohome.org>
 
        * wl-vars.el (wl-message-use-header-narrowing): New user option.
index 79e7038..a452149 100644 (file)
           (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))))))
index 12f9523..6c3f1bc 100644 (file)
@@ -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))