2001-05-09 Kenichi OKADA <okada@opaopa.org>
authorokada <okada>
Wed, 9 May 2001 07:10:10 +0000 (07:10 +0000)
committerokada <okada>
Wed, 9 May 2001 07:10:10 +0000 (07:10 +0000)
* wl-folder.el (wl-folder-guess-mailing-list-by-refile-rule-subr):
New function.
(wl-folder-guess-mailing-list-by-folder-name-subr): New function.
(wl-folder-guess-mailing-list-by-refile-rule): Fix for multi folder.
(wl-folder-guess-mailing-list-by-folder-name): Ditto.

wl/ChangeLog
wl/wl-folder.el

index 2265e19..ef922eb 100644 (file)
@@ -1,3 +1,11 @@
+2001-05-09  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl-folder.el (wl-folder-guess-mailing-list-by-refile-rule-subr):
+       New function.
+       (wl-folder-guess-mailing-list-by-folder-name-subr): New function.
+       (wl-folder-guess-mailing-list-by-refile-rule): Fix for multi folder.
+       (wl-folder-guess-mailing-list-by-folder-name): Ditto.
+
 2001-05-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-mime.el (wl-mime-setup): Added setting for
index a330e78..c384614 100644 (file)
@@ -2034,18 +2034,29 @@ If FOLDER is multi, return comma separated string (cross post)."
       (setq flist (cdr flist)))
     (list nil nil newsgroups)))
 
-(defun wl-folder-guess-mailing-list-by-refile-rule (folder)
+(defun wl-folder-guess-mailing-list-by-refile-rule (entity)
   "Return ML address guess by FOLDER.
-Use `wl-subscribed-mailing-list' and `wl-refile-rule-alist'.
-Don't care multi."
-;;; XXXXX FIX ME 
-;;;  (setq folder (car
-;;;            (elmo-folder-get-primitive-list
-;;;             (wl-folder-get-elmo-folder folder))))
-  (unless (memq (elmo-folder-type folder)
+Use `wl-subscribed-mailing-list' and `wl-refile-rule-alist'."
+  (let ((flist
+        (elmo-folder-get-primitive-list
+         (wl-folder-get-elmo-folder entity)))
+       fld ret mlist)
+    (while (setq fld (car flist))
+      (if (setq ret
+               (wl-folder-guess-mailing-list-by-refile-rule-subr
+                (elmo-folder-name-internal fld)))
+         (setq mlist (if (stringp mlist)
+                         (concat mlist ", " ret)
+                       ret)))
+      (setq flist (cdr flist)))
+    (if mlist
+       (list mlist nil nil))))
+
+(defun wl-folder-guess-mailing-list-by-refile-rule-subr (entity)
+  (unless (memq (elmo-folder-type entity)
                '(localnews nntp))
     (let ((rules wl-refile-rule-alist)
-         mladdress tokey toalist histkey)
+         tokey toalist)
       (while rules
        (if (or (and (stringp (car (car rules)))
                     (string-match "[Tt]o" (car (car rules))))
@@ -2054,35 +2065,41 @@ Don't care multi."
                                                 'case-ignore)))
            (setq toalist (append toalist (cdr (car rules)))))
        (setq rules (cdr rules)))
-      (setq tokey (car (rassoc folder toalist)))
+      (setq tokey (car (rassoc entity toalist)))
 ;;;     (setq histkey (car (rassoc folder wl-refile-alist)))
       ;; case-ignore search `wl-subscribed-mailing-list'
       (if (stringp tokey)
-         (list
-          (elmo-string-matched-member tokey wl-subscribed-mailing-list t)
-          nil nil)
-       nil))))
+         (elmo-string-matched-member tokey wl-subscribed-mailing-list t)))))
 
-(defun wl-folder-guess-mailing-list-by-folder-name (folder)
+(defun wl-folder-guess-mailing-list-by-folder-name (entity)
   "Return ML address guess by FOLDER name's last hierarchy.
 Use `wl-subscribed-mailing-list'."
-  ;; Don't care multi folder.  FIX ME
-  (setq folder (car (elmo-folder-get-primitive-list
-                    (wl-folder-get-elmo-folder folder))))
-  (when (memq (elmo-folder-type-internal folder)
+  (let ((flist
+        (elmo-folder-get-primitive-list
+         (wl-folder-get-elmo-folder entity)))
+       fld ret mlist)
+    (while (setq fld (car flist))
+      (if (setq ret
+               (wl-folder-guess-mailing-list-by-folder-name-subr
+                (elmo-folder-name-internal fld)))
+         (setq mlist (if (stringp mlist)
+                         (concat mlist ", " ret)
+                       ret)))
+      (setq flist (cdr flist)))
+    (if mlist
+       (list mlist nil nil))))
+
+(defun wl-folder-guess-mailing-list-by-folder-name-subr (entity)
+  (when (memq (elmo-folder-type entity)
              '(localdir imap4 maildir))
-    (let (key mladdress foldername)
+    (let (key foldername)
       ;; Get foldername and Remove folder type symbol.
-      (setq foldername (substring (elmo-folder-name-internal folder) 1))
+      (setq foldername (substring entity 1))
       (when (string-match "[^\\./]+$" foldername)
        (setq key (regexp-quote
                   (concat (substring foldername (match-beginning 0)) "@")))
-       (setq mladdress
-             (elmo-string-matched-member
-              key wl-subscribed-mailing-list 'case-ignore))
-       (if (stringp mladdress)
-           (list mladdress nil nil)
-         nil)))))
+       (elmo-string-matched-member
+        key wl-subscribed-mailing-list 'case-ignore)))))
 
 (defun wl-folder-update-diff-line (diffs)
   (let ((inhibit-read-only t)