From: hmurata Date: Mon, 10 Jan 2005 12:40:08 +0000 (+0000) Subject: * elmo-access.el: New file. X-Git-Tag: wl-2_14-root~95 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3095c8a8f037224fe6307aac0230f30ace665b77;p=elisp%2Fwanderlust.git * elmo-access.el: New file. * elmo-null.el: Ditto. * elmo-internal.el (elmo-internal-folder-list): Added `null'. * WL-ELS (ELMO-MODULES): Added elmo-access and elmo-null. --- diff --git a/ChangeLog b/ChangeLog index f3d35a1..da89a2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-10 Hiroya Murata + + * WL-ELS (ELMO-MODULES): Added elmo-access and elmo-null. + 2005-01-01 TAKAHASHI Kaoru * README, README.ja: Update stable branch. diff --git a/WL-ELS b/WL-ELS index 47e954f..b7f8269 100644 --- a/WL-ELS +++ b/WL-ELS @@ -19,9 +19,9 @@ elmo-date elmo-util elmo-version elmo-vars elmo elmo-msgdb elmo-net elmo-imap4 elmo-pop3 elmo-nntp elmo-localdir elmo-localnews elmo-map elmo-maildir - elmo-multi elmo-filter + elmo-multi elmo-access elmo-filter elmo-archive elmo-pipe elmo-cache - elmo-internal elmo-flag elmo-sendlog + elmo-internal elmo-flag elmo-sendlog elmo-null elmo-dop elmo-nmz elmo-file elmo-split elmo-spam elsp-bogofilter elsp-sa elsp-bsfilter elsp-spamoracle modb modb-entity modb-legacy modb-standard diff --git a/doc/wl-ja.texi b/doc/wl-ja.texi index c95d460..840722b 100644 --- a/doc/wl-ja.texi +++ b/doc/wl-ja.texi @@ -696,7 +696,7 @@ Wanderlust $B$O(B ELMO $B$N%$%s%?%U%'!<%9$rMxMQ$7$F$$$k$?$a!"(BELMO $B%b%8% $B%P!<%8%g%s(B @value{VERSION} $B8=:_!"MQ0U$5$l$F$$$k%U%)%k%@$O!"(BIMAP, NNTP, LocalDir(MH), Maildir, News Spool, Archive, POP, Shimbun, Namazu, Multi, -Filter, Pipe, Internal, File $B$N(B 14 $B$r;XDj$7$^$9!#(B -@node File Folder, , Internal Folder, Folders +@node File Folder, Access Folder, Internal Folder, Folders @section $B%U%!%$%k%U%)%k%@(B @cindex File Folder @@ -1795,6 +1796,29 @@ file:/etc -> @file{/etc} @end example +@node Access Folder, , File Folder, Folders +@section $B%"%/%;%9%U%)%k%@(B +@cindex Access Folder + +$B;XDj$5$l$?%U%)%k%@$NG[2<$N%5%V%U%)%k%@$r2>A[E*$K0l$D$N%U%)%k%@$H$7$F07$((B +$B$k$h$&$K$9$k%U%)%k%@$G$9!#%5%V%U%)%k%@$NA}8:$O<+F0E*$KH?1G$5$l$^$9!#(B + +$B=q<0(B: + +@example +@samp{access:} @var{$B%k!<%H%U%)%k%@(B} +@end example + +$BNc(B: + +@example +@group +access:%INBOX -> %INBOX $B0J2<$N(B IMAP $B$N%a!<%k%\%C%/%9$NA4$F(B +access:'cache -> $BA4$F$N(B 'cache $B%U%)%k%@(B +@end group +@end example + + @node Folder, Summary, Folders, Top @chapter $B%U%)%k%@%b!<%I(B @cindex Folder @@ -7340,7 +7364,7 @@ spam $B%a!<%k$G$"$k$3$H$r<($9%X%C%@$N@55,I=8=$r;XDj$7$^$9!#(B @end table -@node Regular Expressions Header Matching, , SpamAssassin, Spam Filter Processors +@node Regular Expressions Header Matching, , SpamOracle, Spam Filter Processors @subsection Regular Expressions Header Matching @cindex Regular Expressions Header Matching diff --git a/doc/wl.texi b/doc/wl.texi index e0ccad5..e29f214 100644 --- a/doc/wl.texi +++ b/doc/wl.texi @@ -671,9 +671,10 @@ This chapter describes the folder types which Wanderlust is able to handle. Wanderlust uses ELMO as it's interface, so you can use every folder types supported by ELMO. -As of version @value{VERSION}, 14 types of folders are predefined. These +As of version @value{VERSION}, 15 types of folders are predefined. These are IMAP, NNTP, LocalDir(MH), Maildir, News Spool, Archive, POP, -Shimbun, Namazu, Multi, Filter, Pipe, Internal and File folder types. +Shimbun, Namazu, Multi, Filter, Pipe, File, Access and Internal folder +types. @menu * IMAP Folder:: @samp{%} -- IMAP folder @@ -690,6 +691,7 @@ Shimbun, Namazu, Multi, Filter, Pipe, Internal and File folder types. * Pipe Folder:: @samp{|} -- Pipe folder * Internal Folder:: @samp{'} -- Internal folder * File Folder:: -- File folder +* Access Folder:: -- Access folder @end menu @@ -1747,7 +1749,7 @@ the name of the subdirectories of the cache directory (@file{~/.elmo/cache}). -@node File Folder, , Internal Folder, Folders +@node File Folder, Access Folder, Internal Folder, Folders @section File folder @cindex File Folder @@ -1770,6 +1772,31 @@ file:/etc -> @file{/etc} @end example +@node Access Folder, , File Folder, Folders +@section Access folder +@cindex Access Folder + +A folder to access virtual folder which collects messages from a root +folder and subfolders of one. The add and remove of the subfolder is +automatically reflected. + + +Format: + +@example +@samp{access:} @var{root-folder} +@end example + +Example: + +@example +@group +access:%INBOX -> All subfolders of IMAP mailbox "inbox". +access:'cache -> All of 'cache folder +@end group +@end example + + @node Folder, Summary, Folders, Top @chapter Folder mode @cindex Folder @@ -7393,7 +7420,7 @@ when you change the @code{spam_header} parameter in the config file. @end table -@node Regular Expressions Header Matching, , SpamAssassin, Spam Filter Processors +@node Regular Expressions Header Matching, , SpamOracle, Spam Filter Processors @subsection Regular Expressions Header Matching @cindex Regular Expressions Header Matching diff --git a/elmo/ChangeLog b/elmo/ChangeLog index f5bfd16..04329c0 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2005-01-10 Hiroya Murata + + * elmo-access.el: New file. + + * elmo-null.el: Ditto. + + * elmo-internal.el (elmo-internal-folder-list): Added `null'. + 2005-01-08 Yuuichi Teranishi * elmo-net.el (elmo-network-session-idle-timeout): New option. diff --git a/elmo/elmo-access.el b/elmo/elmo-access.el new file mode 100644 index 0000000..4aa955b --- /dev/null +++ b/elmo/elmo-access.el @@ -0,0 +1,131 @@ +;;; elmo-access.el --- Auto Collect Multiple Folder Interface for ELMO. + +;; Copyright (C) 2005 Yuuichi Teranishi + +;; Author: Hiroya Murata +;; Keywords: mail, net news + +;; This file is part of ELMO (Elisp Library for Message Orchestration). + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. +;; + +;;; Commentary: +;; + +;;; Code: +;; +(require 'elmo) +(require 'elmo-multi) + +(defvar elmo-access-folder-list-filename "flist" + "Folder list cache.") + +(eval-and-compile + (luna-define-class elmo-access-folder (elmo-multi-folder) + (base-folder)) + (luna-define-internal-accessors 'elmo-access-folder)) + +(luna-define-method elmo-folder-initialize ((folder elmo-access-folder) name) + (elmo-access-folder-set-base-folder-internal + folder + (elmo-make-folder name)) + (elmo-multi-folder-set-children-internal + folder + (mapcar #'elmo-make-folder + (elmo-object-load + (expand-file-name elmo-access-folder-list-filename + (elmo-folder-msgdb-path folder))))) + (elmo-multi-folder-set-divide-number-internal + folder + elmo-multi-divide-number) + (elmo-access-folder-update-children folder) + folder) + +(luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-access-folder)) + (expand-file-name (elmo-replace-string-as-filename + (elmo-folder-name-internal folder)) + (expand-file-name "access" elmo-msgdb-directory))) + +(defvar elmo-access-substitute-folder nil) + +(defun elmo-access-substitute-folder () + (or elmo-access-substitute-folder + (setq elmo-access-substitute-folder + (elmo-make-folder "'null")))) + +(defun elmo-access-folder-update-children (folder &optional open expunge) + (elmo-multi-folder-set-children-internal + folder + (if (elmo-folder-plugged-p + (elmo-access-folder-base-folder-internal folder)) + (let ((subfolders (elmo-folder-list-subfolders + (elmo-access-folder-base-folder-internal folder))) + children) + (dolist (child (elmo-multi-folder-children-internal folder)) + (let ((name (elmo-folder-name-internal child))) + (cond ((member name subfolders) + (setq children (nconc children (list child)))) + (expunge) + (t + (setq children + (nconc children + (list (elmo-access-substitute-folder)))))) + (setq subfolders (delete name subfolders)))) + (if subfolders + (nconc children + (mapcar (lambda (name) + (let ((folder (elmo-make-folder name))) + (when open + (elmo-folder-open-internal folder)) + folder)) + subfolders)) + children)) + (mapcar (lambda (f) + (if (elmo-folder-exists-p f) + f + (elmo-access-substitute-folder))) + (elmo-multi-folder-children-internal folder))))) + +(luna-define-method elmo-folder-open-internal + :before ((folder elmo-access-folder)) + (elmo-access-folder-update-children folder)) + +(luna-define-method elmo-folder-commit :after ((folder elmo-access-folder)) + (when (elmo-folder-persistent-p folder) + (elmo-object-save + (expand-file-name elmo-access-folder-list-filename + (elmo-folder-msgdb-path folder)) + (mapcar (lambda (f) (elmo-folder-name-internal f)) + (elmo-multi-folder-children-internal folder))))) + +(luna-define-method elmo-folder-check :before ((folder elmo-access-folder)) + (elmo-access-folder-update-children folder 'open)) + +(luna-define-method elmo-folder-synchronize :before + ((folder elmo-access-folder) + &optional disable-killed ignore-msgdb no-check mask) + (when (or ignore-msgdb + (not no-check)) + (elmo-access-folder-update-children folder 'open ignore-msgdb))) + +(luna-define-method elmo-folder-creatable-p ((folder elmo-access-folder)) + nil) + +(require 'product) +(product-provide (provide 'elmo-access) (require 'elmo-version)) + +;;; elmo-access.el.el ends here diff --git a/elmo/elmo-internal.el b/elmo/elmo-internal.el index ae489ea..bb99742 100644 --- a/elmo/elmo-internal.el +++ b/elmo/elmo-internal.el @@ -33,7 +33,7 @@ ;;; ELMO internal folder (luna-define-class elmo-internal-folder (elmo-folder) ()) -(defvar elmo-internal-folder-list '(flag cache sendlog)) +(defvar elmo-internal-folder-list '(flag cache sendlog null)) (defvar elmo-internal-obsolete-folder-list '((mark flag))) (luna-define-method elmo-folder-initialize ((folder diff --git a/elmo/elmo-null.el b/elmo/elmo-null.el new file mode 100644 index 0000000..b2b5faa --- /dev/null +++ b/elmo/elmo-null.el @@ -0,0 +1,89 @@ +;;; elmo-null.el --- /dev/null Folder Interface for ELMO. + +;; Copyright (C) 2005 Yuuichi Teranishi + +;; Author: Hiroya Murata +;; Keywords: mail, net news + +;; This file is part of ELMO (Elisp Library for Message Orchestration). + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. +;; + +;;; Commentary: +;; + +;;; Code: +;; +(require 'elmo) + +(eval-and-compile + (luna-define-class elmo-null-folder (elmo-folder))) + +(luna-define-method elmo-folder-initialize ((folder elmo-null-folder) name) + folder) + +(luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-null-folder)) + (expand-file-name "null" (expand-file-name "internal" elmo-msgdb-directory))) + +(luna-define-method elmo-folder-open ((folder elmo-null-folder) + &optional load-msgdb)) + +(luna-define-method elmo-folder-commit ((folder elmo-null-folder))) + +(luna-define-method elmo-folder-diff ((folder elmo-null-folder)) + '(0 . 0)) + +(luna-define-method elmo-folder-list-messages ((folder elmo-null-folder) + &optional visible-only in-msgdb) + nil) + +(luna-define-method elmo-folder-list-flagged ((folder elmo-null-folder) + flag &optional in-msgdb) + nil) + +(luna-define-method elmo-folder-count-flags ((folder elmo-null-folder)) + nil) + +(luna-define-method elmo-folder-have-subfolder-p ((folder elmo-null-folder)) + nil) + +(luna-define-method elmo-folder-exists-p ((folder elmo-null-folder)) + t) + +(luna-define-method elmo-folder-writable-p ((folder elmo-null-folder)) + t) + +(luna-define-method elmo-folder-append-messages ((folder elmo-null-folder) + src-folder + numbers + &optional + same-number) + (elmo-progress-notify 'elmo-folder-move-messages (length numbers)) + numbers) + +(luna-define-method elmo-folder-synchronize ((folder elmo-null-folder) + &optional + disable-killed + ignore-msgdb + no-check + mask) + nil) + +(require 'product) +(product-provide (provide 'elmo-null) (require 'elmo-version)) + +;;; elmo-null.el.el ends here