From: hmurata Date: Wed, 9 May 2001 07:06:43 +0000 (+0000) Subject: * elmo.el (elmo-folder-list-importants): Rewirte. Use global mark X-Git-Tag: wl-2_6-root^3~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6352abd539b10a75346aadefbff1788b1c5ea353;p=elisp%2Fwanderlust.git * elmo.el (elmo-folder-list-importants): Rewirte. Use global mark instead of current mark. * elmo-multi.el (elmo-folder-list-importants-internal): No operation if importants is not list. * elmo-filter.el (elmo-filter-folder-list-importants-internal): Return t if importants is not list. * elmo-map.el (elmo-map-folder-list-importants): Define. (elmo-folder-list-importants-internal): Check return value of `elmo-map-folder-list-importants-internal'. * elmo-cache.el (elmo-folder-list-importants-internal): Eliminated. * elmo-mark.el (elmo-folder-list-importants-internal): Ditto. * elmo-nmz.el (elmo-folder-list-importants-internal): Ditto. * elmo-shimbun.el (elmo-folder-list-importants-internal): Ditto. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7232c20..7b7e4d9 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,26 @@ +2001-05-09 Hiroya Murata + + * elmo.el (elmo-folder-list-importants): Rewirte. Use global mark + instead of current mark. + + * elmo-multi.el (elmo-folder-list-importants-internal): No + operation if importants is not list. + + * elmo-filter.el (elmo-filter-folder-list-importants-internal): + Return t if importants is not list. + + * elmo-map.el (elmo-map-folder-list-importants): Define. + (elmo-folder-list-importants-internal): Check return value of + `elmo-map-folder-list-importants-internal'. + + * elmo-cache.el (elmo-folder-list-importants-internal): Eliminated. + + * elmo-mark.el (elmo-folder-list-importants-internal): Ditto. + + * elmo-nmz.el (elmo-folder-list-importants-internal): Ditto. + + * elmo-shimbun.el (elmo-folder-list-importants-internal): Ditto. + 2001-05-08 Yuuichi Teranishi * elmo.el (elmo-message-fetch-confirm): Fixed docstring. diff --git a/elmo/elmo-cache.el b/elmo/elmo-cache.el index 7c4e308..a046d83 100644 --- a/elmo/elmo-cache.el +++ b/elmo/elmo-cache.el @@ -202,10 +202,6 @@ ((folder elmo-cache-folder) unread-marks &optional mark-alist) t) -(luna-define-method elmo-folder-list-importants-internal - ((folder elmo-cache-folder) important-mark) - t) - (luna-define-method elmo-folder-unmark-important ((folder elmo-cache-folder) numbers) t) diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index b682b0c..ff4dc2b 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -141,19 +141,12 @@ (let ((importants (elmo-folder-list-importants-internal (elmo-filter-folder-target-internal folder) important-mark))) - (unless (listp importants) - (setq importants - (delq nil - (mapcar - (function - (lambda (x) - (if (string= (cadr x) important-mark) - (car x)))) - (elmo-msgdb-get-mark-alist (elmo-folder-msgdb folder)))))) - (elmo-list-filter - (mapcar 'car (elmo-msgdb-get-number-alist - (elmo-folder-msgdb folder))) - importants))) + (if (listp importants) + (elmo-list-filter + (mapcar 'car (elmo-msgdb-get-number-alist + (elmo-folder-msgdb folder))) + importants) + t))) (luna-define-method elmo-folder-list-importants-internal ((folder elmo-filter-folder) diff --git a/elmo/elmo-map.el b/elmo/elmo-map.el index 5b10067..85d87c0 100644 --- a/elmo/elmo-map.el +++ b/elmo/elmo-map.el @@ -87,6 +87,9 @@ (luna-define-generic elmo-map-folder-list-importants (folder) "") +(luna-define-method elmo-map-folder-list-importants ((folder elmo-map-folder)) + t) + (luna-define-generic elmo-map-folder-delete-messages (folder locations) "") @@ -283,9 +286,10 @@ (luna-define-method elmo-folder-list-importants-internal ((folder elmo-map-folder) important-mark) - (elmo-map-folder-locations-to-numbers - folder - (elmo-map-folder-list-importants folder))) + (let ((locations (elmo-map-folder-list-importants folder))) + (if (listp locations) + (elmo-map-folder-locations-to-numbers folder locations) + t))) (luna-define-method elmo-folder-delete-messages ((folder elmo-map-folder) numbers) diff --git a/elmo/elmo-mark.el b/elmo/elmo-mark.el index 4e3a4d0..cdfffab 100644 --- a/elmo/elmo-mark.el +++ b/elmo/elmo-mark.el @@ -189,10 +189,6 @@ ((folder elmo-mark-folder) unread-marks &optional mark-alist) t) -(luna-define-method elmo-folder-list-importants-internal - ((folder elmo-mark-folder) important-mark) - t) - (luna-define-method elmo-folder-unmark-important ((folder elmo-mark-folder) numbers) t) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index b25de92..23d5332 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -422,24 +422,18 @@ all-importants) (while folders (setq cur-number (+ cur-number 1)) - (unless (listp (setq importants - (elmo-folder-list-importants-internal - (car folders) important-mark))) - (setq importants (delq nil - (mapcar - (lambda (x) - (if (string= (cadr x) important-mark) - (car x))) - (car mark-alists))))) - (setq all-importants - (nconc all-importants - (mapcar - (lambda (x) - (+ x - (* cur-number - (elmo-multi-folder-divide-number-internal - folder)))) - importants))) + (when (listp (setq importants + (elmo-folder-list-importants-internal + (car folders) important-mark))) + (setq all-importants + (nconc all-importants + (mapcar + (lambda (x) + (+ x + (* cur-number + (elmo-multi-folder-divide-number-internal + folder)))) + importants)))) (setq mark-alists (cdr mark-alists) folders (cdr folders))) all-importants)) diff --git a/elmo/elmo-nmz.el b/elmo/elmo-nmz.el index c361f20..c768d26 100644 --- a/elmo/elmo-nmz.el +++ b/elmo/elmo-nmz.el @@ -220,10 +220,6 @@ ((folder elmo-nmz-folder) unread-marks &optional mark-alist) t) -(luna-define-method elmo-folder-list-importants-internal - ((folder elmo-nmz-folder) important-mark) - t) - (luna-define-method elmo-folder-unmark-important ((folder elmo-nmz-folder) numbers) t) diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 16eb0b8..6f7cb47 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -293,10 +293,6 @@ ((folder elmo-shimbun-folder) unread-marks &optional mark-alist) t) -(luna-define-method elmo-folder-list-importants-internal - ((folder elmo-shimbun-folder) important-mark) - t) - (luna-define-method elmo-folder-unmark-important ((folder elmo-shimbun-folder) numbers) t) diff --git a/elmo/elmo.el b/elmo/elmo.el index c790a85..ae2f5d2 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -220,17 +220,22 @@ UNREAD-MARKS is the unread marks." (defun elmo-folder-list-importants (folder important-mark) "Returns a list of important message numbers contained in FOLDER. IMPORTANT-MARK is the important mark." - (let ((list (elmo-folder-list-importants-internal folder important-mark))) - (if (listp list) - list - ;; Not available, use current mark. - (delq nil - (mapcar - (function - (lambda (x) - (if (string= (cadr x) important-mark) - (car x)))) - (elmo-msgdb-get-mark-alist (elmo-folder-msgdb folder))))))) + (let ((importants (elmo-folder-list-importants-internal folder important-mark)) + (number-alist (elmo-msgdb-get-number-alist + (elmo-folder-msgdb folder))) + num-pair result) + (dolist (mark-pair (or elmo-msgdb-global-mark-alist + (setq elmo-msgdb-global-mark-alist + (elmo-object-load + (expand-file-name + elmo-msgdb-global-mark-filename + elmo-msgdb-dir))))) + (if (and (string= important-mark (cdr mark-pair)) + (setq num-pair (rassoc (car mark-pair) number-alist))) + (setq result (cons (car num-pair) result)))) + (if (listp importants) + (elmo-uniq-list (nconc result importants)) + result))) (luna-define-generic elmo-folder-list-messages-internal (folder &optional visible-only)