From 6ca435ee8377b4ece50affeb901cd5ca77fe61c0 Mon Sep 17 00:00:00 2001 From: teranisi Date: Fri, 29 Sep 2000 09:18:18 +0000 Subject: [PATCH] * 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/ChangeLog | 6 ++++++ elmo/elmo-maildir.el | 32 ++++++++++++++++++++++++++++++++ elmo/elmo-msgdb.el | 2 ++ elmo/elmo2.el | 2 +- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 5b0d853..6fb2ce0 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,11 @@ 2000-09-29 Yuuichi Teranishi + * 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. diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 10a61a6..7f44835 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -480,6 +480,38 @@ file name for maildir directories." (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 diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index c012ce0..f9f28ac 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -444,6 +444,8 @@ content of MSGDB is changed." (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) diff --git a/elmo/elmo2.el b/elmo/elmo2.el index ff71a73..f27fa5f 100644 --- a/elmo/elmo2.el +++ b/elmo/elmo2.el @@ -538,7 +538,7 @@ without cacheing." (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")))) -- 1.7.10.4