From: teranisi Date: Mon, 19 Nov 2001 01:13:34 +0000 (+0000) Subject: * wl-folder.el (wl-folder-get-newsgroups): Use `elmo-folder-newsgroups'. X-Git-Tag: wl-2_8-root~144 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ba73c38820510691bbd7e51526d9c8dc30263545;p=elisp%2Fwanderlust.git * wl-folder.el (wl-folder-get-newsgroups): Use `elmo-folder-newsgroups'. * 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. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 00675bb..af6006b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,20 @@ +2001-11-19 Yuuichi Teranishi + + * 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 * elmo-shimbun.el (elmo-shimbun-update-overview-folder-list): New diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 5ce73ba..e9d6b74 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -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 diff --git a/elmo/elmo-localnews.el b/elmo/elmo-localnews.el index 70317ed..e66714e 100644 --- a/elmo/elmo-localnews.el +++ b/elmo/elmo-localnews.el @@ -31,7 +31,17 @@ ;;; 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) @@ -43,12 +53,14 @@ (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)) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 4a93b4d..316b2db 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -78,6 +78,16 @@ (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 diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 39a7fa0..327bdd2 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -111,6 +111,9 @@ (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) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index f88e29a..dcc1d33 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -163,6 +163,9 @@ ;; 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)))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 1e09e33..e21e4c7 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -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)) diff --git a/wl/ChangeLog b/wl/ChangeLog index 2de33a6..929431a 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2001-11-19 Yuuichi Teranishi + + * wl-folder.el (wl-folder-get-newsgroups): Use + `elmo-folder-newsgroups'. + 2001-11-18 Kenichi OKADA * wl-draft.el (wl-draft-config-sub-header-top): New fucntion. diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 63f4cb9..5a47007 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -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.