* elmo.el (elmo-folder-list-importants): Rewirte. Use global mark
authorhmurata <hmurata>
Wed, 9 May 2001 07:06:43 +0000 (07:06 +0000)
committerhmurata <hmurata>
Wed, 9 May 2001 07:06:43 +0000 (07:06 +0000)
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.

elmo/ChangeLog
elmo/elmo-cache.el
elmo/elmo-filter.el
elmo/elmo-map.el
elmo/elmo-mark.el
elmo/elmo-multi.el
elmo/elmo-nmz.el
elmo/elmo-shimbun.el
elmo/elmo.el

index 7232c20..7b7e4d9 100644 (file)
@@ -1,3 +1,26 @@
+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.
index 7c4e308..a046d83 100644 (file)
   ((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)
index b682b0c..ff4dc2b 100644 (file)
   (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)
index 5b10067..85d87c0 100644 (file)
@@ -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)
   "")
 
 
 (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)
index 4e3a4d0..cdfffab 100644 (file)
   ((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)
index b25de92..23d5332 100644 (file)
        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))
index c361f20..c768d26 100644 (file)
   ((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)
index 16eb0b8..6f7cb47 100644 (file)
   ((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)
index c790a85..ae2f5d2 100644 (file)
@@ -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)