Add ESEARCH feature entry to NEWS & NEWS.ja.
[elisp/wanderlust.git] / wl / wl-batch.el
1 ;;; wl-batch.el --- batch functions for Wanderlust.
2
3 ;; Copyright (C) 2003 Yuuichi Teranishi <teranisi@gohome.org>
4 ;; Copyright (C) 2003 Chihiro Kuroda <chee@iijmio-mail.jp>
5
6 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>,
7 ;;         Chihiro Kuroda <chee@iijmio-mail.jp>
8 ;; Keywords: mail, net news, batch
9
10 ;; This file is not part of GNU Emacs
11
12 ;; This program is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16 ;;
17 ;; This program is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ;; GNU General Public License for more details.
21 ;;
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
26 ;;
27
28 ;;; Commentary:
29 ;;
30 ;; You can use functions in this file from command line.
31 ;; For example,
32 ;;
33 ;; % emacs -batch -l wl-batch -f wl-batch-prefetch
34
35 (require 'wl)
36
37 ;;; Code:
38 (defgroup wl-batch nil
39   "Wanderlust, batch processing."
40   :prefix "wl-"
41   :group 'wl)
42
43 (defcustom wl-batch-prefetch-folder-list nil
44   "A list of folder name to prefetch by `wl-batch-prefetch'."
45   :type '(repeat string)
46   :group 'wl-batch)
47
48 (defcustom wl-batch-prefetch-max-number 100
49   "Max number for summary update while prefetching."
50   :type 'integer
51   :group 'wl-batch)
52
53 (defun wl-batch-prefetch ()
54   "A batch function to prefetch messages by Emacs batch process."
55   (interactive)
56   (wl 1)
57   (let ((elmo-folder-update-threshold wl-batch-prefetch-max-number)
58         wl-demo elmo-folder-update-confirm
59         wl-interactive-exit)
60     (dolist (entity wl-batch-prefetch-folder-list)
61       (wl-folder-check-entity entity)
62       (wl-folder-prefetch-entity entity))
63     (wl-exit)))
64
65 (provide 'wl-batch)
66
67 ;;; wl-batch.el ends here