* wl-folder.el (wl-folder-guess-mailing-list-by-folder-name): New
authorkaoru <kaoru>
Wed, 8 Nov 2000 11:31:23 +0000 (11:31 +0000)
committerkaoru <kaoru>
Wed, 8 Nov 2000 11:31:23 +0000 (11:31 +0000)
function.
* wl-summary.el (wl-summary-write-current-folder-functions):
Change default value.  Use it.

wl/ChangeLog
wl/wl-folder.el
wl/wl-summary.el

index e464bd2..37c5b24 100644 (file)
@@ -1,3 +1,10 @@
+2000-11-08  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * wl-folder.el (wl-folder-guess-mailing-list-by-folder-name): New
+       function.
+       * wl-summary.el (wl-summary-write-current-folder-functions):
+       Change default value.  Use it.
+
 2000-11-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * Version number is increased to 2.4.0.
index 90c7f7f..8a11d7b 100644 (file)
@@ -2047,6 +2047,22 @@ Don't care multi."
           nil nil)
        nil))))
 
+(defun wl-folder-guess-mailing-list-by-folder-name (folder)
+  "Return ML address guess by FOLDER name's last hierarchy.
+Use `wl-subscribed-mailing-list'.  Don't care multi."
+  (setq folder (car (elmo-folder-get-primitive-folder-list folder)))
+  (when (memq (elmo-folder-get-type folder)
+             '(localdir imap4 maildir))
+    (let (key mladdress)
+      (when (string-match "[^\\./]+$" folder)
+       (setq key (concat "^" (substring folder (match-beginning 0)) "@"))
+       (setq mladdress
+             (elmo-string-matched-member
+              key wl-subscribed-mailing-list 'case-ignore))
+       (if (stringp mladdress)
+           (list mladdress nil nil)
+         nil)))))
+
 (defun wl-folder-update-diff-line (diffs)
   (let ((inhibit-read-only t)
        (buffer-read-only nil)
index 729cb7f..33ca8c1 100644 (file)
@@ -5119,8 +5119,8 @@ Reply to author if invoked with ARG."
 
 (defvar wl-summary-write-current-folder-functions
   '(wl-folder-get-newsgroups
-;;; wl-folder-guess-mailing-list-by-refile-rule
-    )
+    wl-folder-guess-mailing-list-by-refile-rule
+    wl-folder-guess-mailing-list-by-folder-name)
   "Newsgroups or Mailing List address guess functions list.
 Call from `wl-summary-write-current-folder'")