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-09 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * 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 <teranisi@gohome.org>
* elmo.el (elmo-message-fetch-confirm): Fixed docstring.
((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)
(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)
(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)
"")
(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)
((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)
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))
((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)
((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)
(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)