* wl-folder.el (wl-folder-get-newsgroups): Use `elmo-folder-newsgroups'.
authorteranisi <teranisi>
Mon, 19 Nov 2001 01:13:34 +0000 (01:13 +0000)
committerteranisi <teranisi>
Mon, 19 Nov 2001 01:13:34 +0000 (01:13 +0000)
* elmo.el (elmo-folder-newsgroups): New generic function.

* elmo-localnews.el (elmo-localnews-folder): Added `group' slot.
(elmo-folder-initialize): Set it.
(elmo-folder-expand-msgdb-path): Use it.
(elmo-folder-newsgroups): Define.

* elmo-filter.el (elmo-folder-newsgroups): Define.

* elmo-pipe.el (elmo-folder-newsgroups): Ditto.

* elmo-nntp.el (elmo-folder-newsgroups): Ditto.

* elmo-multi.el (elmo-folder-newsgroups): Ditto.

elmo/ChangeLog
elmo/elmo-filter.el
elmo/elmo-localnews.el
elmo/elmo-multi.el
elmo/elmo-nntp.el
elmo/elmo-pipe.el
elmo/elmo.el
wl/ChangeLog
wl/wl-folder.el

index 00675bb..af6006b 100644 (file)
@@ -1,3 +1,20 @@
+2001-11-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo.el (elmo-folder-newsgroups): New generic function.
+
+       * elmo-localnews.el (elmo-localnews-folder): Added `group' slot.
+       (elmo-folder-initialize): Set it.
+       (elmo-folder-expand-msgdb-path): Use it.
+       (elmo-folder-newsgroups): Define.
+
+       * elmo-filter.el (elmo-folder-newsgroups): Define.
+
+       * elmo-pipe.el (elmo-folder-newsgroups): Ditto.
+
+       * elmo-nntp.el (elmo-folder-newsgroups): Ditto.
+
+       * elmo-multi.el (elmo-folder-newsgroups): Ditto.
+
 2001-11-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo-shimbun.el (elmo-shimbun-update-overview-folder-list): New
index 5ce73ba..e9d6b74 100644 (file)
@@ -64,6 +64,9 @@
    (elmo-replace-string-as-filename (elmo-folder-name-internal folder))
    (expand-file-name "filter" elmo-msgdb-dir)))
 
+(luna-define-method elmo-folder-newsgroups ((folder elmo-filter-folder))
+  (elmo-folder-newsgroups (elmo-filter-folder-target-internal folder)))
+
 (luna-define-method elmo-find-fetch-strategy
   ((folder elmo-filter-folder) entity &optional ignore-cache)
   (elmo-find-fetch-strategy
index 70317ed..e66714e 100644 (file)
 ;;; Code:
 ;; 
 (require 'elmo-localdir)
-(luna-define-class elmo-localnews-folder (elmo-localdir-folder) ())
+
+(eval-and-compile
+  (luna-define-class elmo-localnews-folder (elmo-localdir-folder) (group))
+  (luna-define-internal-accessors 'elmo-localnews-folder))
+
+(luna-define-method elmo-folder-initialize :before ((folder
+                                                    elmo-localnews-folder)
+                                                   name)
+  (elmo-localnews-folder-set-group-internal folder
+                                           (elmo-replace-in-string
+                                            name "/" "\\.")))
 
 (luna-define-method elmo-localdir-folder-path ((folder elmo-localnews-folder))
   elmo-localnews-folder-path)
 (luna-define-method elmo-folder-expand-msgdb-path ((folder
                                                    elmo-localnews-folder))
   (expand-file-name
-   (elmo-replace-in-string (elmo-localdir-folder-dir-name-internal folder)
-                          "/" "\\.")
+   (elmo-localnews-folder-group-internal folder)
    (expand-file-name
     (symbol-name (elmo-folder-type-internal folder))
     elmo-msgdb-dir)))
 
+(luna-define-method elmo-folder-newsgroups ((folder elmo-localnews-folder))
+  (list (elmo-localnews-folder-group-internal folder)))
+
 (require 'product)
 (product-provide (provide 'elmo-localnews) (require 'elmo-version))
 
index 4a93b4d..316b2db 100644 (file)
                    (expand-file-name "multi"
                                      elmo-msgdb-dir)))
 
+(luna-define-method elmo-folder-newsgroups ((folder elmo-multi-folder))
+  (delq nil
+       (elmo-flatten
+        (mapcar
+         'elmo-folder-newsgroups
+         (elmo-flatten
+          (mapcar 
+           'elmo-folder-get-primitive-list
+           (elmo-multi-folder-children-internal folder)))))))
+
 (luna-define-method elmo-folder-get-primitive-list ((folder elmo-multi-folder))
   (elmo-flatten
    (mapcar 
index 39a7fa0..327bdd2 100644 (file)
                      (expand-file-name "nntp"
                                        elmo-msgdb-dir)))))
 
+(luna-define-method elmo-folder-newsgroups ((folder elmo-nntp-folder))
+  (list (elmo-nntp-folder-group-internal folder)))
+
 ;;; NNTP Session
 (eval-and-compile
   (luna-define-class elmo-nntp-session (elmo-network-session)
index f88e29a..dcc1d33 100644 (file)
   ;; Share with destination...OK?
   (elmo-folder-expand-msgdb-path (elmo-pipe-folder-dst-internal folder)))
 
+(luna-define-method elmo-folder-newsgroups ((folder elmo-pipe-folder))
+  (elmo-folder-newsgroups (elmo-pipe-folder-target-internal folder)))
+
 (luna-define-method elmo-folder-creatable-p ((folder elmo-pipe-folder))
   (and (elmo-folder-creatable-p (elmo-pipe-folder-src-internal folder))
        (elmo-folder-creatable-p (elmo-pipe-folder-dst-internal folder))))
index 1e09e33..e21e4c7 100644 (file)
@@ -600,6 +600,12 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).")
 (luna-define-generic elmo-folder-append-msgdb (folder append-msgdb)
   "Append  APPEND-MSGDB to the current msgdb of the folder.")
 
+(luna-define-generic elmo-folder-newsgroups (folder)
+  "Return list of newsgroup name of FOLDER.")
+
+(luna-define-method elmo-folder-newsgroups ((folder elmo-folder))
+  nil)
+
 (luna-define-method elmo-folder-open ((folder elmo-folder)
                                      &optional load-msgdb)
   (elmo-generic-folder-open folder load-msgdb))
index 2de33a6..929431a 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-folder.el (wl-folder-get-newsgroups): Use
+       `elmo-folder-newsgroups'.
+
 2001-11-18  Kenichi OKADA  <okada@opaopa.org>
 
        * wl-draft.el (wl-draft-config-sub-header-top): New fucntion.
index 63f4cb9..5a47007 100644 (file)
@@ -2029,23 +2029,9 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'."
 (defun wl-folder-get-newsgroups (folder)
   "Return Newsgroups field value string for FOLDER newsgroup.
 If FOLDER is multi, return comma separated string (cross post)."
-  (let ((flist (elmo-folder-get-primitive-list
-               (wl-folder-get-elmo-folder folder))) ; multi
-       newsgroups fld ret)
-    (while (setq fld (car flist))
-      (if (setq ret
-               (cond ((eq 'nntp (elmo-folder-type-internal fld))
-                      (elmo-nntp-folder-group-internal fld))
-                     ((eq 'localnews (elmo-folder-type-internal fld))
-                      (elmo-replace-in-string
-                       (elmo-localdir-folder-dir-name-internal fld)
-                       "/" "\\."))))
-         ;; append newsgroup
-         (setq newsgroups (if (stringp newsgroups)
-                              (concat newsgroups "," ret)
-                            ret)))
-      (setq flist (cdr flist)))
-    (list nil nil newsgroups)))
+  (list nil nil (mapconcat 'identity
+                          (elmo-folder-newsgroups folder)
+                          ",")))
 
 (defun wl-folder-guess-mailing-list-by-refile-rule (entity)
   "Return ML address guess by FOLDER.