* elmo-localdir.el (elmo-folder-expand-msgdb-path): Expand
[elisp/wanderlust.git] / elmo / elmo-archive.el
index 4db7c42..ce97bb6 100644 (file)
@@ -309,7 +309,7 @@ TYPE specifies the archiver's symbol."
                      (not (eobp)))  ; for GNU tar 981010
            (setq file-list (nconc file-list (list (string-to-int
                                                    (match-string 1)))))))
-      (error "%s does not exist." file))
+      (error "%s does not exist" file))
     (if nonsort
        (cons (or (elmo-max-of-list file-list) 0)
              (if killed
@@ -522,7 +522,7 @@ TYPE specifies the archiver's symbol."
     (elmo-mapcar-list-of-list
      (function (lambda (x)
                 (if (file-exists-p
-                     (expand-file-name 
+                     (expand-file-name
                       (concat elmo-archive-basename
                               (elmo-archive-get-suffix
                                (elmo-archive-folder-archive-type-internal
@@ -607,7 +607,8 @@ TYPE specifies the archiver's symbol."
             nil))))))
 
 (luna-define-method elmo-folder-append-messages :around
-  ((folder elmo-archive-folder) src-folder numbers &optional same-number)
+  ((folder elmo-archive-folder) src-folder numbers unread-marks
+   &optional same-number)
   (let ((prefix (elmo-archive-folder-archive-prefix-internal folder)))
     (cond
      ((and same-number
@@ -900,7 +901,9 @@ TYPE specifies the archiver's symbol."
       (elmo-archive-msgdb-create-entity-subr number))))
 
 (luna-define-method elmo-folder-msgdb-create ((folder elmo-archive-folder)
-                                             numbers seen-list)
+                                             numbers new-mark
+                                             already-mark seen-mark
+                                             important-mark seen-list)
   (when numbers
     (save-excursion ;; 981005
       (if (and elmo-archive-use-izip-agent
@@ -908,11 +911,17 @@ TYPE specifies the archiver's symbol."
                (elmo-archive-folder-archive-type-internal folder)
                'cat-headers))
          (elmo-archive-msgdb-create-as-numlist-subr2
-          folder numbers seen-list)
+          folder numbers new-mark already-mark seen-mark important-mark
+          seen-list)
        (elmo-archive-msgdb-create-as-numlist-subr1
-        folder numbers seen-list)))))
+        folder numbers new-mark already-mark seen-mark important-mark
+        seen-list)))))
 
-(defun elmo-archive-msgdb-create-as-numlist-subr1 (folder numlist seen-list)
+(defun elmo-archive-msgdb-create-as-numlist-subr1 (folder
+                                                  numlist new-mark
+                                                  already-mark seen-mark
+                                                  important-mark
+                                                  seen-list)
   (let* ((type (elmo-archive-folder-archive-type-internal folder))
         (file (elmo-archive-get-archive-name folder))
         (method (elmo-archive-get-method type 'cat))
@@ -945,10 +954,10 @@ TYPE specifies the archiver's symbol."
                             (elmo-file-cache-get message-id))
                            (if seen
                                nil
-                             elmo-msgdb-unread-cached-mark)
+                             already-mark)
                          (if seen
-                             elmo-msgdb-read-uncached-mark
-                           elmo-msgdb-new-mark))))
+                             seen-mark
+                           new-mark))))
              (setq mark-alist
                    (elmo-msgdb-mark-append
                     mark-alist
@@ -966,7 +975,9 @@ TYPE specifies the archiver's symbol."
 
 ;;; info-zip agent
 (defun elmo-archive-msgdb-create-as-numlist-subr2 (folder
-                                                  numlist
+                                                  numlist new-mark
+                                                  already-mark seen-mark
+                                                  important-mark
                                                   seen-list)
   (let* ((delim1 elmo-mmdf-delimiter)          ;; MMDF
         (delim2 elmo-unixmail-delimiter)       ;; UNIX Mail
@@ -1000,7 +1011,10 @@ TYPE specifies the archiver's symbol."
        (goto-char (point-min))
        (cond
         ((looking-at delim1)   ;; MMDF
-         (setq result (elmo-archive-parse-mmdf msgs seen-list))
+         (setq result (elmo-archive-parse-mmdf msgs
+                                               new-mark
+                                               already-mark seen-mark
+                                               seen-list))
          (setq overview (append overview (nth 0 result)))
          (setq number-alist (append number-alist (nth 1 result)))
          (setq mark-alist (append mark-alist (nth 2 result))))
@@ -1019,7 +1033,10 @@ TYPE specifies the archiver's symbol."
           percent))))
     (list overview number-alist mark-alist)))
 
-(defun elmo-archive-parse-mmdf (msgs seen-list)
+(defun elmo-archive-parse-mmdf (msgs new-mark
+                                    already-mark
+                                    seen-mark
+                                    seen-list)
   (let ((delim elmo-mmdf-delimiter)
        number sp ep rest entity overview number-alist mark-alist ret-val
        message-id seen gmark)
@@ -1052,17 +1069,16 @@ TYPE specifies the archiver's symbol."
                             (elmo-file-cache-get message-id))
                            (if seen
                                nil
-                             elmo-msgdb-unread-cached-mark)
+                             already-mark)
                          (if seen
-                             elmo-msgdb-read-uncached-mark
-                           elmo-msgdb-new-mark))))
+                             seen-mark
+                           new-mark))))
              (setq mark-alist
                    (elmo-msgdb-mark-append
                     mark-alist
                     (elmo-msgdb-overview-entity-get-number entity)
                     gmark)))
-         (setq ret-val (append ret-val (list overview number-alist
-                                             mark-alist)))
+         (setq ret-val (append ret-val (list overview number-alist mark-alist)))
          (widen)))
       (forward-line 1)
       (setq rest (cdr rest)))