2000-09-29 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-maildir.el (elmo-maildir-pack-number): Implemented.
+
+ * elmo-msgdb.el (elmo-msgdb-delete-msgs): Save location data.
+
+ * elmo2.el (elmo-pack-number): Added 'maildir as allowd type.
+
* elmo-imap4.el (elmo-imap4-search-internal-primitive): Fixed
arguments for `SEARCH' command.
(elmo-imap4-parse-string): Set `POS' argument for char-after.
(elmo-msgdb-expand-path
nil spec)))))
+(defun elmo-maildir-pack-number (spec msgdb arg)
+ (let ((old-number-alist (elmo-msgdb-get-number-alist msgdb))
+ (old-overview (elmo-msgdb-get-overview msgdb))
+ (old-mark-alist (elmo-msgdb-get-mark-alist msgdb))
+ (old-location (elmo-msgdb-get-location msgdb))
+ old-number overview number-alist mark-alist location
+ mark (number 1))
+ (setq overview old-overview)
+ (while old-overview
+ (setq old-number
+ (elmo-msgdb-overview-entity-get-number (car old-overview)))
+ (elmo-msgdb-overview-entity-set-number (car old-overview) number)
+ (setq number-alist
+ (cons (cons number (cdr (assq old-number old-number-alist)))
+ number-alist))
+ (when (setq mark (cadr (assq old-number old-mark-alist)))
+ (setq mark-alist
+ (elmo-msgdb-mark-append
+ mark-alist number mark)))
+ (setq location
+ (cons (cons number (cdr (assq old-number old-location)))
+ location))
+ (setq number (1+ number))
+ (setq old-overview (cdr old-overview)))
+ ;; XXX Should consider when folder is not persistent.
+ (elmo-msgdb-location-save (elmo-msgdb-expand-path nil spec) location)
+ (list overview
+ (nreverse number-alist)
+ (nreverse mark-alist)
+ (nreverse location)
+ (elmo-msgdb-make-overview-hashtb overview))))
+
(defalias 'elmo-maildir-sync-number-alist
'elmo-generic-sync-number-alist)
(defalias 'elmo-maildir-list-folder-unread
(delq (assq (car msg-list) number-alist) number-alist))
(setq mark-alist (delq (assq (car msg-list) mark-alist) mark-alist))
(setq loc-alist (delq (assq (car msg-list) loc-alist) loc-alist))
+ ;; XXX Should consider when folder is not persistent.
+ (elmo-msgdb-location-save dir loc-alist)
(setq msg-list (cdr msg-list)))
(setcar msgdb overview)
(setcar (cdr msgdb) number-alist)
(defun elmo-pack-number (folder msgdb arg)
(let ((type (elmo-folder-get-type folder)))
- (if (memq type '(localdir localnews))
+ (if (memq type '(localdir localnews maildir))
(elmo-call-func folder "pack-number" msgdb arg)
(error "pack-number not supported"))))