1 ;;; elmo-vars.el --- User variables for ELMO.
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
5 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
6 ;; Keywords: mail, net news
8 ;; This file is part of ELMO (Elisp Library for Message Orchestration).
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)
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.
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.
33 ;; silence byte compiler
35 (defun-maybe dynamic-link (a))
36 (defun-maybe dynamic-call (a b)))
38 ;; bind colon keywords for old Emacsen.
41 :symbol-for-testing-whether-colon-keyword-is-available-or-not
43 (let ((kwds '(:cc :date :extra :message-id :number :references :subject)))
45 (set (car kwds) (car kwds))
46 (setq kwds (cdr kwds)))))))
49 "ELMO, Elisp Library for Message Orchestration."
55 (defgroup elmo-setting nil
56 "ELMO common settings."
62 (defcustom elmo-msgdb-default-type 'legacy
63 "*Default type of Message Database for ELMO."
64 :type '(radio (const legacy)
65 (const :tag "No use" generic))
69 (defvar elmo-msgdb-file-header-chop-length 2048
70 "*Number of bytes to get header in one reading from file.")
72 (defcustom elmo-msgdb-directory "~/.elmo"
73 "*ELMO Message Database path."
77 (defvar elmo-passwd-alist-file-name "passwd"
78 "*ELMO Password filename.")
79 (defcustom elmo-passwd-life-time nil
80 "*Duration of ELMO Password in seconds. nil means infinity."
81 :type '(choice (const :tag "Infinity" nil)
86 (defvar elmo-warning-threshold 30000
87 "*Display warning when the bytes of message exceeds this value.")
89 (defvar elmo-msg-appended-hook nil
90 "A hook called when message is appended to database.")
91 (defvar elmo-msg-deleted-hook nil
92 "A hook called when message is deleted from database.")
93 (defvar elmo-nntp-post-pre-hook nil
94 "A hook called just before the nntp posting.")
98 (defcustom elmo-imap4-default-server "localhost"
99 "*Default IMAP4 server."
102 :group 'elmo-setting)
104 (defcustom elmo-imap4-default-authenticate-type 'login
105 "*Default Authentication type for IMAP4."
106 :type '(radio (const :tag "encoded password transmission (login)" login)
107 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
108 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
109 (const :tag "plain password transmission (clear)" clear)
110 (const :tag "NTLM authentication (ntlm)" ntlm)
111 (function :tag "Other"))
114 (defcustom elmo-imap4-default-user (or (getenv "USER")
117 "*Default username for IMAP4."
120 :group 'elmo-setting)
122 (defcustom elmo-imap4-default-port 143
123 "*Default Port number of IMAP."
126 :group 'elmo-setting)
128 (defcustom elmo-imap4-default-stream-type nil
129 "*Default stream type for IMAP4.
130 Any symbol value of `elmo-network-stream-type-alist' or
131 `elmo-imap4-stream-type-alist'."
135 (defvar elmo-imap4-stream-type-alist nil
136 "*Stream bindings for IMAP4.
137 This is taken precedence over `elmo-network-stream-type-alist'.")
142 (defcustom elmo-nntp-default-server "localhost"
143 "*Default NNTP server."
146 :group 'elmo-setting)
148 (defcustom elmo-nntp-default-user nil
149 "*Default User of NNTP. nil means no user authentication."
150 :type '(choice (const nil)
153 :group 'elmo-setting)
155 (defcustom elmo-nntp-default-port 119
156 "*Default Port number of NNTP."
159 :group 'elmo-setting)
161 (defcustom elmo-nntp-default-stream-type nil
162 "*Default stream type for NNTP.
163 Any symbol value of `elmo-network-stream-type-alist' or
164 `elmo-nntp-stream-type-alist'."
168 (defvar elmo-nntp-stream-type-alist nil
169 "*Stream bindings for NNTP.
170 This is taken precedence over `elmo-network-stream-type-alist'.")
175 (defcustom elmo-pop3-default-user (or (getenv "USER")
178 "*Default username for POP3."
181 :group 'elmo-setting)
183 (defcustom elmo-pop3-default-server "localhost"
184 "*Default POP3 server."
187 :group 'elmo-setting)
189 (defcustom elmo-pop3-default-authenticate-type 'user
190 "*Default Authentication type for POP3."
191 :type '(radio (const :tag "plain password transmission (user)" user)
192 (const :tag "APOP authentication (apop)" apop)
193 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
194 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
195 (const :tag "NTLM authentication (ntlm)" ntlm)
196 (function :tag "Other"))
199 (defcustom elmo-pop3-default-port 110
200 "*Default POP3 port."
203 :group 'elmo-setting)
205 (defcustom elmo-pop3-default-stream-type nil
206 "*Default stream type for POP3.
207 Any symbol value of `elmo-network-stream-type-alist' or
208 `elmo-pop3-stream-type-alist'."
212 (defvar elmo-pop3-stream-type-alist nil
213 "*Stream bindings for POP3.
214 This is taken precedence over `elmo-network-stream-type-alist'.")
216 (defcustom elmo-lang "ja"
217 "Language for displayed messages."
219 :group 'elmo-setting)
221 (defvar elmo-mime-charset 'iso-2022-jp)
223 (defvar elmo-msgdb-mark-filename "mark"
225 (defvar elmo-msgdb-overview-filename "overview"
226 "Overview database.")
227 (defvar elmo-msgdb-number-filename "number"
228 "Message number <=> Message-ID database.")
229 (defvar elmo-msgdb-location-filename "location"
230 "Message number <=> Actual location symbol.")
231 (defvar elmo-msgdb-seen-filename "seen"
232 "Seen message list for append.")
233 (defvar elmo-msgdb-killed-filename "killed"
234 "Deleted messages... contains elmo-killed-msgs-list.")
235 (defvar elmo-msgdb-validity-filename "validity")
236 (defvar elmo-msgdb-flist-filename "flist"
237 "Folder list cache (for access folder).")
238 (defvar elmo-msgdb-finfo-filename "finfo"
239 "Folder information cache...list of '(filename . '(new unread all)).")
240 (defvar elmo-msgdb-lock-list-filename "lock"
241 "Locked messages...list of message-id.
242 For disconnected operations.")
243 (defvar elmo-lost+found-folder "+lost+found"
245 (defvar elmo-crosspost-alist-filename "crosspost-alist"
246 "Alist of crosspost messages.")
248 (defvar elmo-use-server-diff t
249 "Non-nil forces to get unread message information on server.")
251 (defvar elmo-strict-diff-folder-list nil
252 "List of regexps of folder name which should be checked its diff strictly.")
254 (defcustom elmo-msgdb-extra-fields nil
255 "Extra fields for msgdb."
256 :type '(repeat string)
258 :group 'elmo-setting)
260 (defcustom elmo-enable-disconnected-operation t
261 "*Non-nil enables disconnected operations."
264 :group 'elmo-setting)
266 (defvar elmo-auto-change-plugged 600
267 "*Time to expire change plugged state automatically, as the number of seconds.
268 Don't change plugged state automatically if nil.")
269 (defvar elmo-plugged-condition 'one
270 "*The condition for `elmo-plugged' becomes on.
271 If `all', when all ports are on. If `one', when even one port is on.
272 If `independent', independent port plugged.
273 If function, return value of function.")
275 (defvar elmo-plug-on-servers nil)
277 (defvar elmo-plug-on-exclude-servers
280 (and (string-match "[^.]+" (system-name))
281 (substring (system-name) 0 (match-end 0)))))
283 (defvar elmo-plugged-alist nil)
285 (defvar elmo-dop-flush-confirm t
286 "*Flush disconnected operations queue with confirmation.")
288 (defvar elmo-path-sep "/"
290 (defvar elmo-plugged t)
292 (defvar elmo-no-subject "(No Subject in original.)"
293 "*A string used when no subject field exists.")
294 (defvar elmo-no-from "nobody@nowhere?"
295 "*A string used when no from field exists.")
297 ;; database dynamic linking
298 (defvar elmo-database-dl-module
299 (expand-file-name "database.so" exec-directory))
301 (defvar elmo-database-dl-handle
302 (if (and (fboundp 'dynamic-link)
304 elmo-database-dl-module))
305 (if (fboundp 'open-database)
307 (dynamic-link elmo-database-dl-module))))
309 (if (and elmo-database-dl-handle
310 (integerp elmo-database-dl-handle))
311 (dynamic-call "emacs_database_init" elmo-database-dl-handle))
313 (defvar elmo-use-database (or (featurep 'dbm)
316 (featurep 'berkeley-db)
317 ;; static/dl-database
318 (fboundp 'open-database)))
320 (defvar elmo-date-match t
321 "Date match is available or not.")
323 (defvar elmo-network-stream-type-alist
324 '(("!" ssl ssl open-ssl-stream)
325 ("!!" starttls starttls starttls-open-stream)
326 ("!socks" socks socks socks-open-network-stream))
327 "An alist of (SPEC-STRING SYMBOL FEATURE OPEN-STREAM-FUNCTION).
328 SPEC-STRING is a string for stream-type spec (it must start with '!').
329 SYMBOL is a symbol which indicates the name of the stream type.
330 SYMBOL should be identical in this alist.
331 FEATURE is a symbol of the feature for OPEN-STREAM-FUNCTION.
332 OPEN-STREAM-FUNCTION is a function to open network stream.
333 Arguments for this function are NAME, BUFFER, HOST and SERVICE.")
335 (defvar elmo-folder-info-hashtb nil
336 "Array of folder database information '(max length new unread).")
338 (defvar elmo-crosspost-message-alist nil
339 "List of crosspost message.")
341 (defvar elmo-cache-expire-default-method "size"
342 "Default expiration method.")
344 (defvar elmo-cache-expire-default-size 30000
345 "Cache expiration disk size (Kilo bytes). This must be float value.")
347 (defvar elmo-cache-expire-default-age 50
348 "Cache expiration age (days).")
350 (defvar elmo-cache-directory (expand-file-name "cache" elmo-msgdb-directory)
351 "Directory name for cache storage.")
353 (defvar elmo-pack-number-check-strict t
354 "Pack number strictly.")
356 (defvar elmo-have-link-count
358 ;; OS/2: EMX always returns the link count "1" :-(
359 (or (memq system-type '(OS/2 emx))
360 ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
361 (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
362 "Your file system has link count, or not.")
364 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
365 (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"])
366 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
367 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
369 (defvar elmo-filename-replace-string-alist
380 (defvar elmo-hash-minimum-size 1023
381 "Minimum size of hash table.")
383 (defvar elmo-hash-maximum-size 4095
384 "Maximum size of hash table.")
386 (defvar elmo-use-decoded-cache (featurep 'xemacs)
387 "Use cache of decoded mime charset string.")
389 (defvar elmo-display-progress-threshold 20
390 "*Displaying progress gauge if number of messages are more than this value.")
392 (defvar elmo-inhibit-number-mapping nil
393 "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).")
395 (defvar elmo-display-retrieval-progress-threshold 30000
396 "*Don't display progress if the message size is smaller than this value.")
398 (defvar elmo-inhibit-display-retrieval-progress nil
399 "Global switch to inhibit display progress of each message's retrieval.")
401 (defvar elmo-dop-queue nil
402 "Global variable for storing disconnected operation queues.")
405 (product-provide (provide 'elmo-vars) (require 'elmo-version))
407 ;;; elmo-vars.el ends here