Working branch `elmo-lunafy' is created.
[elisp/wanderlust.git] / elmo / elmo-vars.el
1 ;;; elmo-vars.el -- User variables for ELMO.
2
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
4
5 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
6 ;; Keywords: mail, net news
7
8 ;; This file is part of ELMO (Elisp Library for Message Orchestration).
9
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14 ;;
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19 ;;
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24 ;;
25
26 ;;; Commentary:
27 ;; 
28
29 ;;; Code:
30 ;; 
31 (require 'poe)
32
33 ;; silence byte compiler
34 (eval-when-compile
35   (defun-maybe dynamic-link (a))
36   (defun-maybe dynamic-call (a b)))
37
38 (defgroup elmo nil
39   "ELMO, Elisp Library for Message Orchestration."
40   :tag "ELMO"
41   :group 'news
42   :group 'mail)
43
44 ;; NNTP
45 (defvar elmo-default-nntp-server  "localhost"
46   "*Default NNTP server.")
47 (defvar elmo-default-nntp-user nil
48   "*Default User of NNTP.  nil means no user authentication.")
49 (defvar elmo-default-nntp-port 119
50   "*Default Port number of NNTP.")
51 (defvar elmo-default-nntp-stream-type nil
52   "*Default stream type for NNTP.
53 Any symbol value of `elmo-network-stream-type-alist'.")
54 (defvar elmo-nntp-stream-type-alist nil
55   "*Stream bindings for NNTP.
56 This is taken precedence over `elmo-network-stream-type-alist'.")
57
58 ;; Local
59 (defvar elmo-localdir-folder-path "~/Mail"
60   "*Local mail folder path.")
61 (defvar elmo-localnews-folder-path "~/News"
62   "*Local news folder path.")
63 (defvar elmo-maildir-folder-path "~/Maildir"
64   "*Maildir folder path.")
65 (defvar elmo-maildir-list '("\\+~/Maildir")
66   "*All Folders that match this list will be treated as Maildir.
67 Each elements are regexp of folder name (This is obsolete).")
68
69 (defvar elmo-msgdb-dir "~/.elmo"
70   "*ELMO Message Database path.")
71 (defvar elmo-passwd-alist-file-name "passwd"
72   "*ELMO Password filename.")
73 (defvar elmo-passwd-life-time nil
74   "*Duration of ELMO Password in seconds.  nil means infinity.")
75
76 (defvar elmo-warning-threshold 30000
77   "*Display warning when the bytes of message exceeds this value.")
78
79 (defvar elmo-msg-appended-hook nil
80   "A hook called when message is appended to database.")
81 (defvar elmo-msg-deleted-hook nil
82   "A hook called when message is deleted from database.")
83 (defvar elmo-nntp-post-pre-hook nil
84   "A hook called just before the nntp posting.")
85 (defvar elmo-lang "ja"
86   "Language for displayed messages.")
87
88 (defvar elmo-mime-charset 'iso-2022-jp)
89
90 (defvar elmo-msgdb-mark-filename "mark"
91   "Mark database.")
92 (defvar elmo-msgdb-overview-filename "overview"
93   "Overview database.")
94 (defvar elmo-msgdb-number-filename "number"
95   "Message number <=> Message-ID database.")
96 (defvar elmo-msgdb-location-filename "location"
97   "Message number <=> Actual location symbol.")
98 (defvar elmo-msgdb-seen-filename "seen"
99   "Seen message list for append.")
100 (defvar elmo-msgdb-killed-filename "killed"
101   "Deleted messages... contains elmo-killed-msgs-list.")
102 (defvar elmo-msgdb-validity-filename "validity")
103 (defvar elmo-msgdb-flist-filename "flist"
104   "Folder list cache (for access folder).")
105 (defvar elmo-msgdb-finfo-filename "finfo"
106   "Folder information cache...list of '(filename . '(new unread all)).")
107 (defvar elmo-msgdb-append-list-filename "append"
108   "Appended messages...Structure is same as number-alist.
109 For disconnected operations.")
110 (defvar elmo-msgdb-resume-list-filename "resume"
111   "Resumed messages.  For disconnected operations.")
112 (defvar elmo-msgdb-lock-list-filename "lock"
113   "Locked messages...list of message-id.
114 For disconnected operations.")
115 (defvar elmo-msgdb-global-mark-filename "global-mark"
116   "Alist of global mark.")
117 (defvar elmo-lost+found-folder "+lost+found"
118   "Lost and found.")
119 (defvar elmo-crosspost-alist-filename "crosspost-alist"
120   "Alist of crosspost messages.")
121
122 (defvar elmo-use-server-diff t
123   "Non-nil forces to get unread message information on server.")
124
125 (defvar elmo-strict-diff-folder-list nil
126   "List of regexps of folder name which should be checked its diff strictly.")
127
128 (defvar elmo-msgdb-extra-fields nil
129   "Extra fields for msgdb.")
130
131 (defvar elmo-queue-filename "queue"
132   "*IMAP pending event queue is saved in this file.")
133 (defvar elmo-enable-disconnected-operation nil
134   "*Enable disconnected operations.")
135
136 (defvar elmo-nntp-overview-fetch-chop-length 200
137  "*Number of overviews to fetch in one request in nntp.")
138 (defvar elmo-localdir-header-chop-length 2048
139   "*Number of bytes to get header in one reading from file.")
140
141 (defvar elmo-auto-change-plugged 600
142   "*Time to expire change plugged state automatically, as the number of seconds.
143 Don't change plugged state automatically if nil.")
144 (defvar elmo-plugged-condition 'one
145   "*The condition for `elmo-plugged' becomes on.
146 If `all', when all ports are on.  If `one', when even one port is on.
147 If `independent', independent port plugged.
148 If function, return value of function.")
149
150 (defvar elmo-plug-on-servers nil)
151
152 (defvar elmo-plug-on-exclude-servers
153   (list "localhost"
154         (system-name)
155         (and (string-match "[^.]+" (system-name))
156              (substring (system-name) 0 (match-end 0)))))
157
158 (defvar elmo-plugged-alist nil)
159
160 (defvar elmo-dop-flush-confirm t
161   "*Flush disconnected operations queue with confirmation.")
162
163 (defvar elmo-path-sep "/"
164   "*Path separator.")
165 (defvar elmo-plugged t)
166 (defvar elmo-use-semi nil)
167 (defvar elmo-no-subject "(No Subject in original.)"
168   "*A string used when no subject field exists.")
169 (defvar elmo-no-from "nobody@nowhere?"
170   "*A string used when no from field exists.")
171
172 (defvar elmo-multi-divide-number 100000
173   "*Multi divider number.")
174
175 ;; database dynamic linking
176 (defvar elmo-database-dl-module
177   (expand-file-name "database.so" exec-directory))
178
179 (defvar elmo-database-dl-handle
180   (if (and (fboundp 'dynamic-link)
181            (file-exists-p
182             elmo-database-dl-module))
183       (if (fboundp 'open-database)
184           t ;;
185         (dynamic-link elmo-database-dl-module))))
186
187 (if (and elmo-database-dl-handle
188          (integerp elmo-database-dl-handle))
189     (dynamic-call "emacs_database_init" elmo-database-dl-handle))
190
191 (defvar elmo-use-database (or (featurep 'dbm)
192                               (featurep 'gnudbm)
193                               (featurep 'berkdb)
194                               (featurep 'berkeley-db)
195                               ;; static/dl-database
196                               (fboundp 'open-database)))
197
198 (defvar elmo-date-match (not (boundp 'nemacs-version))
199   "Date match is available or not.")
200
201 (defvar elmo-network-stream-type-alist
202   '(("!"      ssl       ssl      open-ssl-stream)
203     ("!!"     starttls  starttls starttls-open-stream)
204     ("!socks" socks     socks    socks-open-network-stream))
205   "An alist of (SPEC-STRING SYMBOL FEATURE OPEN-STREAM-FUNCTION).
206 SPEC-STRING is a string for stream-type spec (it must start with '!').
207 SYMBOL is a symbol which indicates the name of the stream type.
208 SYMBOL should be identical in this alist.
209 FEATURE is a symbol of the feature for OPEN-STREAM-FUNCTION.
210 OPEN-STREAM-FUNCTION is a function to open network stream.
211 Arguments for this function are NAME, BUFFER, HOST and SERVICE.")
212
213 (defvar elmo-folder-info-hashtb nil
214   "Array of folder database information '(max length new unread).")
215
216 (defvar elmo-crosspost-message-alist nil
217   "List of crosspost message.")
218
219 (defvar elmo-cache-expire-default-method "size"
220   "Default expiration method.")
221
222 (defvar elmo-cache-expire-default-size 30000
223   "Cache expiration disk size (Kilo bytes).  This must be float value.")
224
225 (defvar elmo-cache-expire-default-age 50
226   "Cache expiration age (days).")
227 (defvar elmo-cache-dirname "cache"
228   "Directory name for cache storage.")
229
230 (defvar elmo-use-buffer-cache t
231   "Use buffer cache.")
232
233 (defvar elmo-buffer-cache-size 10
234   "*Number of buffer for message cache.")
235
236 (defvar elmo-pack-number-check-strict t
237   "Pack number strictly.")
238
239 (defvar elmo-have-link-count
240   (not
241    ;; OS/2: EMX always returns the link count "1" :-(
242    (or (memq system-type '(OS/2 emx))
243        ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
244        (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
245   "Your file system has link count, or not.")
246
247 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
248 (defvar elmo-weekday-name-ja '["\e$BF|\e(B" "\e$B7n\e(B" "\e$B2P\e(B" "\e$B?e\e(B" "\e$BLZ\e(B" "\e$B6b\e(B" "\e$BEZ\e(B"])
249 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
250 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
251
252 (defvar elmo-filename-replace-string-alist
253   '((":"  . " c")
254     ("*"  . " a")
255     ("?"  . " q")
256     ("<"  . " l")
257     (">"  . " g")
258     ("\"" . " d")
259     ("|"  . " p")
260     ("/"  . " s")
261     ("\\" . " b")))
262
263 (defvar elmo-nntp-use-cache t
264   "Use cache in nntp folder.")
265
266 (defvar elmo-pop3-use-cache t
267   "Use cache in pop3 folder.")
268
269 (defvar elmo-localdir-lockfile-list nil)
270
271 (defvar elmo-nntp-max-number-precedes-list-active nil
272   "Non-nil means max number of msgdb is set as the max number of `list active'.
273 (Needed for inn 2.3 or later?).")
274
275 (defvar elmo-pop3-send-command-synchronously nil
276   "If non-nil, commands are send synchronously.
277 If server doesn't accept asynchronous commands, this variable should be
278 set as non-nil.")
279
280 (defvar elmo-hash-maximum-size 4096
281   "Maximum size of hash table.")
282
283 (defvar elmo-use-decoded-cache (featurep 'xemacs)
284   "Use cache of decoded mime charset string.")
285
286 (defvar elmo-use-overview-hashtb t
287   "Use hash table of overview.")
288
289 (defvar elmo-display-progress-threshold 20
290   "*Displaying progress gauge if number of messages are more than this value.")
291
292 (require 'product)
293 (product-provide (provide 'elmo-vars) (require 'elmo-version))
294
295 ;;; elmo-vars.el ends here