* elmo-msgdb.el (elmo-living-messages): New function.
authorokazaki <okazaki>
Sun, 1 Oct 2000 09:45:02 +0000 (09:45 +0000)
committerokazaki <okazaki>
Sun, 1 Oct 2000 09:45:02 +0000 (09:45 +0000)
* elmo-archive.el (elmo-archive-list-folder-subr): Use it.
* elmo-cache.el (elmo-cache-list-folder): Ditto.
* elmo-dop.el (elmo-dop-list-folder): Ditto.
* elmo-imap4.el (elmo-imap4-list-folder): Ditto.
* elmo-internal.el (elmo-internal-list-folder-subr): Ditto.
* elmo-localdir.el (elmo-localdir-list-folder-subr): Ditto.
* elmo-maildir.el (elmo-maildir-list-folder-subr): Ditto.
* elmo-multi.el (elmo-multi-list-folder): Ditto.
* elmo-nntp.el (elmo-nntp-list-folder): Ditto.
* elmo-pipe.el (elmo-pipe-list-folder): Ditto.
* elmo-pop3.el (elmo-pop3-list-folder): Ditto.

12 files changed:
elmo/elmo-archive.el
elmo/elmo-cache.el
elmo/elmo-dop.el
elmo/elmo-imap4.el
elmo/elmo-internal.el
elmo/elmo-localdir.el
elmo/elmo-maildir.el
elmo/elmo-msgdb.el
elmo/elmo-multi.el
elmo/elmo-nntp.el
elmo/elmo-pipe.el
elmo/elmo-pop3.el

index c96b003..9f6c2ef 100644 (file)
@@ -269,12 +269,7 @@ TYPE specifies the archiver's symbol."
                  (- (length file-list) (length killed))
                (length file-list)))
       (setq numbers (sort file-list '<))
-      (if killed
-         (delq nil
-               (mapcar (lambda (number)
-                         (unless (memq number killed) number))
-                       numbers))
-      numbers))))
+      (elmo-living-messages numbers killed))))
 
 (defun elmo-archive-list-folder (spec)
   (elmo-archive-list-folder-subr spec))
index 9c4e9f2..24ab6c6 100644 (file)
@@ -665,12 +665,7 @@ Returning its cache buffer."
                      (elmo-msgdb-expand-path nil spec))))
        numbers)
     (setq numbers (elmo-cache-list-folder-subr spec))
-    (if killed
-       (delq nil
-             (mapcar (lambda (number)
-                       (unless (memq number killed) number))
-                     numbers))
-      numbers)))
+    (elmo-living-messages numbers killed)))
 
 (defun elmo-cache-max-of-folder (spec)
   (elmo-cache-list-folder-subr spec t))
index 8180a30..2b32066 100644 (file)
@@ -301,12 +301,7 @@ even an operation concerns the unplugged folder."
                    (append number-list
                            (list (+ max-num i 1))))
              (setq i (+ 1 i)))
-           (if killed
-               (delq nil
-                     (mapcar (lambda (number)
-                               (unless (memq number killed) number))
-                             number-list))
-             number-list))
+           (elmo-living-messages number-list killed))
        (error "Unplugged"))
     ;; not imap4 folder...list folder
     (elmo-call-func folder "list-folder")))
index 3d8979b..7d38d16 100644 (file)
@@ -723,12 +723,7 @@ BUFFER must be a single-byte buffer."
                      (elmo-msgdb-expand-path nil spec))))
        numbers)
     (setq numbers (elmo-imap4-list spec "all"))
-    (if killed
-       (delq nil
-             (mapcar (lambda (number)
-                       (unless (memq number killed) number))
-                     numbers))
-      numbers)))
+    (elmo-living-messages numbers killed)))
 
 (defun elmo-imap4-list-folder-unread (spec msgdb unread-marks)
   (if (elmo-imap4-use-flag-p spec)
index 1d69b68..4288b66 100644 (file)
                  (- (length flist) (length killed))
                (length flist)))
       (setq numbers (sort flist '<))
-      (if killed
-         (delq nil
-               (mapcar (lambda (number)
-                         (unless (memq number killed) number))
-                       numbers))
-       numbers))))
+      (elmo-living-messages numbers killed))))
 
 (defun elmo-internal-list-folder (spec)
   (elmo-internal-list-folder-subr spec))
index c7865e2..9e05370 100644 (file)
                  (- (length flist) (length killed))
                (length flist)))
       (setq numbers (sort flist '<))
-      (if killed
-         (delq nil
-               (mapcar (lambda (number)
-                         (unless (memq number killed) number))
-                       numbers))
-       numbers))))
+      (elmo-living-messages numbers killed))))
 
 (defun elmo-localdir-append-msg (spec string &optional msg no-see)
   (let ((dir (elmo-localdir-get-folder-directory spec))
index 7f44835..54983bf 100644 (file)
@@ -363,12 +363,7 @@ file name for maildir directories."
                     (- (length flist) (length killed))
                   (length flist))))
       (setq numbers (sort flist '<))
-      (if killed
-         (delq nil
-               (mapcar (lambda (number)
-                         (unless (memq number killed) number))
-                       numbers))
-       numbers))))
+      (elmo-living-messages numbers killed))))
 
 (defun elmo-maildir-list-folder (spec)
   (elmo-maildir-update-current spec)
index f9f28ac..b8f0c8e 100644 (file)
@@ -582,6 +582,14 @@ content of MSGDB is changed."
      (nconc (elmo-msgdb-killed-list-load dir)
            msgs))))
 
+(defun elmo-living-messages (messages killed-list)
+  (if killed-list
+      (delq nil
+           (mapcar (lambda (number)
+                     (unless (memq number killed-list) number))
+                   messages))
+    messages))
+
 (defun elmo-msgdb-finfo-load ()
   (elmo-object-load (expand-file-name
                     elmo-msgdb-finfo-filename
index 06bf4fe..4d1a4c0 100644 (file)
                          (* elmo-multi-divide-number cur-number) x)))
                      (elmo-list-folder (car flds)))))
       (setq flds (cdr flds)))
-    (if killed
-       (delq nil
-             (mapcar (lambda (number)
-                       (unless (memq number killed) number))
-                     numbers))
-      numbers)))
+    (elmo-living-messages numbers killed)))
 
 (defun elmo-multi-folder-exists-p (spec)
   (let* ((flds (cdr spec)))
index 6f690f6..e9a6e0c 100644 (file)
@@ -499,12 +499,7 @@ Don't cache if nil.")
              (setq numbers (elmo-nntp-make-msglist
                             (elmo-match-string 2 response)
                             (elmo-match-string 3 response)))))
-       (if killed
-           (delq nil
-                 (mapcar (lambda (number)
-                           (unless (memq number killed) number))
-                         numbers))
-         numbers)))))
+       (elmo-living-messages numbers killed)))))
 
 (defun elmo-nntp-max-of-folder (spec)
   (let* ((port (elmo-nntp-spec-port spec))
index fce64b7..a442fe9 100644 (file)
                      (elmo-msgdb-expand-path nil spec))))
        numbers)
     (setq numbers (elmo-list-folder (elmo-pipe-spec-dst spec)))
-    (if killed
-       (delq nil
-             (mapcar (lambda (number)
-                       (unless (memq number killed) number))
-                     numbers))
-      numbers)))
+    (elmo-living-messages numbers killed)))
 
 (defun elmo-pipe-list-folder-unread (spec msgdb unread-marks)
   (elmo-list-folder-unread (elmo-pipe-spec-dst spec)
index dc10193..5378d6a 100644 (file)
                      (progn
                        (elmo-pop3-list-by-uidl-subr spec))
                    (elmo-pop3-list-by-list spec)))
-    (if killed
-       (delq nil
-             (mapcar (lambda (number)
-                       (unless (memq number killed) number))
-                     numbers))
-      numbers)))
+    (elmo-living-messages numbers killed)))
 
 (defun elmo-pop3-max-of-folder (spec)
   (elmo-pop3-commit spec)