* elmo-access.el: New file.
authorhmurata <hmurata>
Mon, 10 Jan 2005 12:40:08 +0000 (12:40 +0000)
committerhmurata <hmurata>
Mon, 10 Jan 2005 12:40:08 +0000 (12:40 +0000)
* elmo-null.el: Ditto.

* elmo-internal.el (elmo-internal-folder-list): Added `null'.

* WL-ELS (ELMO-MODULES): Added elmo-access and elmo-null.

ChangeLog
WL-ELS
doc/wl-ja.texi
doc/wl.texi
elmo/ChangeLog
elmo/elmo-access.el [new file with mode: 0644]
elmo/elmo-internal.el
elmo/elmo-null.el [new file with mode: 0644]

index f3d35a1..da89a2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * WL-ELS (ELMO-MODULES): Added elmo-access and elmo-null.
+
 2005-01-01  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * README, README.ja: Update stable branch.
diff --git a/WL-ELS b/WL-ELS
index 47e954f..b7f8269 100644 (file)
--- 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
index c95d460..840722b 100644 (file)
@@ -696,7 +696,7 @@ Wanderlust \e$B$O\e(B ELMO \e$B$N%$%s%?%U%'!<%9$rMxMQ$7$F$$$k$?$a!"\e(BELMO \e$B%b%8%
 
 \e$B%P!<%8%g%s\e(B @value{VERSION} \e$B8=:_!"MQ0U$5$l$F$$$k%U%)%k%@$O!"\e(BIMAP, NNTP,
 LocalDir(MH), Maildir, News Spool, Archive, POP, Shimbun, Namazu, Multi,
-Filter, Pipe, Internal, File \e$B$N\e(B 14 \e$B<oN`$G$9!#\e(B
+Filter, Pipe, File, Access, Internal \e$B$N\e(B 15 \e$B<oN`$G$9!#\e(B
 
 @menu
 * IMAP Folder::              @samp{%} -- IMAP \e$B%U%)%k%@\e(B
@@ -713,6 +713,7 @@ Filter, Pipe, Internal, File \e$B$N\e(B 14 \e$B<oN`$G$9!#\e(B
 * Pipe Folder::              @samp{|} -- \e$B%Q%$%W%U%)%k%@\e(B
 * Internal Folder::          @samp{'} -- \e$BFbIt%U%)%k%@\e(B
 * File Folder::                  -- \e$B%U%!%$%k%U%)%k%@\e(B
+* Access Folder::                -- \e$B%"%/%;%9%U%)%k%@\e(B
 @end menu
 
 
@@ -1772,7 +1773,7 @@ Wanderlust \e$B$NFbIt$KJ];}$7$?%a%C%;!<%8$r1\Mw$9$k$?$a$N%U%)%k%@$G$9!#\e(B
 \e$B%G%#%l%/%H%j\e(B (@file{~/.elmo/cache})\e$B$N%5%V%G%#%l%/%H%jL>$r;XDj$7$^$9!#\e(B
 
 
-@node File Folder,  , Internal Folder, Folders
+@node File Folder, Access Folder, Internal Folder, Folders
 @section \e$B%U%!%$%k%U%)%k%@\e(B
 @cindex File Folder
 
@@ -1795,6 +1796,29 @@ file:/etc       -> @file{/etc}
 @end example
 
 
+@node Access Folder,  , File Folder, Folders
+@section \e$B%"%/%;%9%U%)%k%@\e(B
+@cindex Access Folder
+
+\e$B;XDj$5$l$?%U%)%k%@$NG[2<$N%5%V%U%)%k%@$r2>A[E*$K0l$D$N%U%)%k%@$H$7$F07$(\e(B
+\e$B$k$h$&$K$9$k%U%)%k%@$G$9!#%5%V%U%)%k%@$NA}8:$O<+F0E*$KH?1G$5$l$^$9!#\e(B
+
+\e$B=q<0\e(B:
+
+@example
+@samp{access:} @var{\e$B%k!<%H%U%)%k%@\e(B}
+@end example
+
+\e$BNc\e(B:
+
+@example
+@group
+access:%INBOX -> %INBOX \e$B0J2<$N\e(B IMAP \e$B$N%a!<%k%\%C%/%9$NA4$F\e(B
+access:'cache -> \e$BA4$F$N\e(B 'cache \e$B%U%)%k%@\e(B
+@end group
+@end example
+
+
 @node Folder, Summary, Folders, Top
 @chapter \e$B%U%)%k%@%b!<%I\e(B
 @cindex Folder
@@ -7340,7 +7364,7 @@ spam \e$B%a!<%k$G$"$k$3$H$r<($9%X%C%@$N@55,I=8=$r;XDj$7$^$9!#\e(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
 
index e0ccad5..e29f214 100644 (file)
@@ -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
 
index f5bfd16..04329c0 100644 (file)
@@ -1,3 +1,11 @@
+2005-01-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-access.el: New file.
+
+       * elmo-null.el: Ditto.
+
+       * elmo-internal.el (elmo-internal-folder-list): Added `null'.
+
 2005-01-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * 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 (file)
index 0000000..4aa955b
--- /dev/null
@@ -0,0 +1,131 @@
+;;; elmo-access.el --- Auto Collect Multiple Folder Interface for ELMO.
+
+;; Copyright (C) 2005 Yuuichi Teranishi <teranisi@gohome.org>
+
+;; Author: Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+;; 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
index ae489ea..bb99742 100644 (file)
@@ -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 (file)
index 0000000..b2b5faa
--- /dev/null
@@ -0,0 +1,89 @@
+;;; elmo-null.el --- /dev/null Folder Interface for ELMO.
+
+;; Copyright (C) 2005 Yuuichi Teranishi <teranisi@gohome.org>
+
+;; Author: Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+;; 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