* wl-vars.el (wl-draft-sendlog-max-size): Add nil to range.
[elisp/wanderlust.git] / wl / wl-vars.el
1 ;;; wl-vars.el --- Variable definitions for Wanderlust.
2
3 ;; Copyright (C) 1998,1999,2000,2001 Yuuichi Teranishi <teranisi@gohome.org>
4 ;; Copyright (C) 1998,1999,2000,2001 Masahiro MURATA <muse@ba2.so-net.ne.jp>
5
6 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
7 ;;      Masahiro MURATA <muse@ba2.so-net.ne.jp>
8 ;; Keywords: mail, net news
9
10 ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen).
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
31 ;;; Code:
32 ;;
33
34 (require 'elmo-vars)
35 (require 'elmo-util)
36 (require 'elmo-msgdb)
37 (require 'custom)
38
39 ;;; Customizable Variables
40
41 (defgroup wl nil
42   "Wanderlust, a news and mail reading software."
43   :tag "Wanderlust"
44   :link (` (custom-manual
45             (, (if (and (boundp 'current-language-environment)
46                         (string-equal "Japanese"
47                                       (symbol-value 'current-language-environment)))
48                    "(wl-ja)Top"
49                  "(wl)Top"))))
50   :group 'news
51   :group 'mail)
52
53 (defgroup wl-pref nil
54   "Wanderlust, Preferences."
55   :prefix "wl-"
56   :group 'wl)
57
58 (defgroup wl-folder nil
59   "Wanderlust, folder buffer."
60   :prefix "wl-"
61   :group 'wl)
62
63 (defgroup wl-summary nil
64   "Wanderlust, summary buffer."
65   :prefix "wl-"
66   :group 'wl)
67
68 (defgroup wl-summary-marks nil
69   "Wanderlust, marks used in summary buffers."
70   :prefix "wl-summary-"
71   :group 'wl-summary)
72
73 (defgroup wl-expire nil
74   "Wanderlust, Expiring and archiving."
75   :prefix "wl-"
76   :group 'wl)
77
78 (defgroup wl-score nil
79   "Wanderlust, Score file handling."
80   :prefix "wl-"
81   :group 'wl)
82
83 (defgroup wl-highlight nil
84   "Wanderlust, Highlights."
85   :prefix "wl-"
86   :group 'wl)
87
88 (defgroup wl-draft nil
89   "Wanderlust, draft mode."
90   :prefix "wl-"
91   :group 'wl)
92
93 (defgroup wl-setting nil
94   "Wanderlust common settings."
95   :prefix "wl-"
96   :group 'wl)
97
98 ;;; Emacsen
99 (defconst wl-on-xemacs (featurep 'xemacs))
100
101 (defconst wl-on-emacs21 (and (not wl-on-xemacs)
102                              (>= emacs-major-version 21)))
103
104 (defconst wl-on-mule (featurep 'mule))
105
106 (defconst wl-on-mule3
107   (and wl-on-mule (or wl-on-xemacs
108                       (> emacs-major-version 19))))
109
110 (defconst wl-on-nemacs nil) ; backward compatibility.
111
112 (eval-when-compile
113   (defun-maybe locate-data-directory (a)))
114
115 (defvar wl-cs-noconv
116   (cond (wl-on-mule3 'binary)
117         (wl-on-mule  '*noconv*)
118         (t           nil)))
119
120 (defvar wl-cs-autoconv
121   (cond (wl-on-mule3 'undecided)
122         (wl-on-mule  '*autoconv*)
123         (t           nil)))
124
125 (defvar wl-cs-local
126   (cond (wl-on-mule3  'junet)
127         (wl-on-mule   '*junet*)
128         (t           nil)))
129
130 (defvar wl-cs-cache wl-cs-local)
131
132 (defcustom wl-from (and user-mail-address
133                         (concat (and (user-full-name)
134                                      (concat (elmo-address-quote-specials
135                                               (user-full-name))
136                                              " "))
137                                 "<" user-mail-address ">"))
138   "*From string used in draft."
139   :type  'string
140   :group 'wl
141   :group 'wl-setting)
142
143 (defcustom wl-user-mail-address-list nil
144   "*A list of user's mail addresses.
145 This list is used to judge whether an address is user's or not.
146 You should set this variable if you use multiple e-mail addresses.
147 If you don't have multiple e-mail addresses, you don't have to set this."
148   :type '(repeat string)
149   :group 'wl
150   :group 'wl-setting)
151
152 (defcustom wl-organization (getenv "ORGANIZATION")
153   "Organization name."
154   :type '(choice (const :tag "none" nil)
155                  string)
156   :group 'wl
157   :group 'wl-setting)
158
159 (defcustom wl-temporary-file-directory "~/tmp/"
160   "*Default temporary directory to save message, part."
161   :type 'directory
162   :group 'wl)
163
164 (defcustom wl-icon-directory (if (fboundp 'locate-data-directory)
165                                  (locate-data-directory "wl")
166                                (let ((icons (expand-file-name "wl/icons/"
167                                                               data-directory)))
168                                  (if (file-directory-p icons)
169                                      icons)))
170   "*Directory to load the icon files from, or nil if none."
171   :type '(choice (const :tag "none" nil)
172                  string)
173   :group 'wl)
174
175 (defcustom wl-summary-default-view 'thread
176   "Default status of summary view, thread or sequential view."
177   :type '(choice (const :tag "Thread" thread)
178                  (const :tag "Sequential" sequence))
179   :group 'wl-summary)
180
181 (defcustom wl-summary-default-view-alist nil
182   "An alist of regexp for folder name and summary default view.
183 If no match, `wl-summary-default-view' is used."
184   :type '(repeat (cons (regexp :tag "Folder Regexp")
185                        (choice (const :tag "Thread" thread)
186                                (const :tag "Sequential" sequence))))
187   :group 'wl-summary)
188
189 (defvar wl-summary-mode-line-format-spec-alist
190   '((?f (if (memq 'modeline wl-use-folder-petname)
191             (wl-folder-get-petname (elmo-folder-name-internal
192                                     wl-summary-buffer-elmo-folder))
193           (elmo-folder-name-internal wl-summary-buffer-elmo-folder)))
194     (?t (if (eq wl-summary-buffer-view 'thread) "T" "S"))
195     (?n wl-summary-buffer-new-count)
196     (?u (+ wl-summary-buffer-new-count
197            wl-summary-buffer-unread-count))
198     (?a (length wl-summary-buffer-number-list)))
199   "An alist of format specifications that can appear in summary mode-lines.
200 Each element is a list of following:
201 \(SPEC STRING-EXP)
202 SPEC is a character for format specification.
203 STRING-EXP is an expression to get string to insert.")
204
205 (defcustom wl-summary-mode-line-format "Wanderlust: %f {%t}(%n/%u/%a)"
206   "*A format string for summary mode-line of Wanderlust.
207 It may include any of the following format specifications
208 which are replaced by the given information:
209
210 %f The folder name.
211 %t The thread status of the summary ('T' for thread, 'S' for sequential).
212 %n The number of new messages.
213 %u The number of unread messages (includes new messages).
214 %a The number of all messages."
215   :group 'wl-summary
216   :type 'string)
217
218 (defvar wl-summary-line-format-spec-alist
219   '((?Y (wl-summary-line-year))
220     (?M (wl-summary-line-month))
221     (?D (wl-summary-line-day))
222     (?W (wl-summary-line-day-of-week))
223     (?h (wl-summary-line-hour))
224     (?m (wl-summary-line-minute))
225     (?\[ (if wl-thr-linked "<" "["))
226     (?\] (if wl-thr-linked ">" "]"))
227     (?t (or wl-thr-indent-string ""))
228     (?s (wl-summary-line-subject))
229     (?S (wl-summary-line-size))
230     (?C (if wl-thr-children-number
231             (concat "[+" (number-to-string wl-thr-children-number) "] ")
232           (if wl-parent-message-entity
233               (if wl-thr-linked ">>" ">")
234             "")))
235     (?~ (if (zerop (length wl-line-string)) "" " "))
236     (?c (if wl-thr-children-number
237             (concat "+" (number-to-string wl-thr-children-number) ":")
238           ""))
239     (?f (wl-summary-line-from))
240     (?# (wl-summary-line-list-info))
241     (?l (wl-summary-line-list-count))
242     (?T (or wl-temp-mark " "))
243     (?P (or wl-persistent-mark " "))
244     (?n (wl-summary-line-number))
245     (?@ (wl-summary-line-attached)))
246   "An alist of format specifications that can appear in summary lines.
247 Each element is a list of following:
248 \(SPEC STRING-EXP)
249 SPEC is a character for format specification.
250 STRING-EXP is an expression to get string to insert.")
251
252 (defcustom wl-summary-line-format "%n%T%P%M/%D(%W)%h:%m %t%[%17(%c %f%) %] %s"
253   "*A default format string for summary line of Wanderlust.
254 It may include any of the following format specifications
255 which are replaced by the given information:
256
257 %n The number of the message.
258    The width is decided using `wl-summary-default-number-column' and
259    `wl-summary-number-column-alist'.
260 %T The temporal mark (*, D, o, O).
261 %P The persistent mark (status of the message).
262 %Y The year of the date field of the message (zero padded).
263 %M The month of the date field of the message (zero padded).
264 %D The day of the date field of the message (zero padded).
265 %W The weekday name of the date field of the message (zero padded).
266 %h The hour of the date field of the message (zero padded).
267 %m The minute of the date field of the message (zero padded).
268 %[ An open bracket.  If the message thread is linked,
269    it is replaced with '<'.
270 %] A close bracket.  If the message thread is linked,
271    it is replaced with '>'.
272 %c The children number of the closed message thread.
273    Children number is printed like '+??:'.
274 %C The children number of the closed message thread.
275    Children number is printed like '[+??] '.
276    If the message is opened, '>' or '>>' (linked) is displayed.
277 %f The from: field string of the message.
278 %s The subject: field string of the message.
279 %S The size of the message (if available).
280 %~ If the previous spec is not zero-length, replaced with ' '.
281
282 If the format string contains the specifiers %( and %), the text between
283 them will have the specified number of columns."
284   :group 'wl-summary
285   :type 'string)
286
287 (defcustom wl-folder-summary-line-format-alist nil
288   "An alist of folder name and a summary line format.
289 If no match, `wl-summary-line-format' is used.
290 e.x.
291       '((\"^%\" . \"%n%T%P%M/%D(%W)%h:%m %t%[%14(%c %f%) %](%S) %s\")
292         (\"^@2ch\" . \"%n%T%P%M%/%D/%h:%m %t[%9(%c %f%) ]%s\")))"
293   :type '(repeat (cons (regexp :tag "Folder Regexp")
294                        (string :tag "line format")))
295   :group 'wl-summary)
296
297 (defcustom wl-summary-check-line-format t
298   "*Check summary line format change if non-nil.
299 When summary line format is changed, current summary cache is discarded.
300 It is highly recommended to set this value to t."
301   :type 'boolean
302   :group 'wl-summary)
303
304 (defcustom wl-summary-line-format-file ".wl-summary-line-format"
305   "*Cache file for summary line format."
306   :type 'file
307   :group 'wl-summary)
308
309 (defcustom wl-summary-from-function 'wl-summary-default-from
310   "*A function for displaying sender (From: field) information."
311   :type 'function
312   :group 'wl-summary)
313
314 (defcustom wl-summary-subject-function 'wl-summary-default-subject
315   "*A function for displaying subject."
316   :type 'function
317   :group 'wl-summary)
318
319 (defcustom wl-summary-subject-filter-function 'wl-summary-default-subject-filter
320   "*A filter function for comparing subjects."
321   :type 'function
322   :group 'wl-summary)
323
324 (defcustom wl-summary-search-parent-by-subject-regexp "^[ \t]*\\(\\[[^:]+[,: ][0-9]+\\]\\)?[ \t]*re[\\^[:> ]"
325   "*If message does not have in-reply-to field nor references field and
326 subject matches this regexp, search parent message by subject matching.
327 If nil, never search search parent by subject."
328   :type '(choice string
329                  (const :tag "Don't search parent" nil))
330   :group 'wl-summary)
331
332 ;;; Mark & Action
333 (defcustom wl-summary-mark-action-list
334   '(("*"
335      target-mark
336      nil
337      wl-summary-register-target-mark
338      nil
339      wl-highlight-summary-temp-face
340      "Put target mark.")
341     ("d"
342      dispose
343      nil
344      wl-summary-register-temp-mark
345      wl-summary-exec-action-dispose
346      wl-highlight-summary-disposed-face
347      "Dispose messages according to `wl-dispose-folder-alist'.")
348     ("D"
349      delete
350      nil
351      wl-summary-register-temp-mark
352      wl-summary-exec-action-delete
353      wl-highlight-summary-deleted-face
354      "Delete messages immediately.")
355     ("o"
356      refile
357      wl-summary-get-refile-destination
358      wl-summary-set-action-refile
359      wl-summary-exec-action-refile
360      wl-highlight-summary-refiled-face
361      "Refile messages to the other folder.")
362     ("O"
363      copy
364      wl-summary-get-copy-destination
365      wl-summary-register-temp-mark
366      wl-summary-exec-action-copy
367      wl-highlight-summary-copied-face
368      "Copy messages to the other folder.")
369     ("i"
370      prefetch
371      nil
372      wl-summary-register-temp-mark
373      wl-summary-exec-action-prefetch
374      wl-highlight-summary-prefetch-face
375      "Prefetch messages.")
376     ("~"
377      resend
378      wl-summary-get-resend-address
379      wl-summary-register-temp-mark
380      wl-summary-exec-action-resend
381      wl-highlight-summary-resend-face
382      "Resend messages."))
383   "A variable to define Mark & Action.
384 Each element of the list should be a list of
385 \(MARK
386   SYMBOL
387   ARGUMENT-FUNCTION
388   SET-MARK-FUNCTION
389   EXEC-FUNCTION
390   FACE
391   DOC-STRING)
392
393 MARK is a temporal mark string to define.
394 SYMBOL is an action name to define.
395 ARGUMENT-FUNCTION is a function called to set the argument data for
396 SET-MARK-FUNCTION.
397 Its argument is (ACTION NUMBER).
398 ACTION is same as the SYMBOL.
399 NUMBER is the message number to determine the argument data.
400 SET-MARK-FUNCTION is a function called to set the mark.
401 Its argument is (NUMBER MARK DATA).
402 NUMBER is the target message number.
403 MARK is the temporary mark string.
404 DATA is given by ARGUMENT-FUNCTION.
405 EXEC-FUNCTION is a function called to execute the action.
406 Its argument is a list of MARK-INFO.
407 MARK-INFO is a list of (NUMBER MARK DATA).
408 FACE is a face for highlighting."
409   :type '(repeat (string :tag "Temporary mark")
410                  (symbol :tag "Set mark function")
411                  (symbol :tag "Unset mark function")
412                  (symbol :tag "Exec function")
413                  (symbol :tag "Face symbol")
414                  (string :tag "Document string"))
415   :group 'wl-summary)
416
417 ;; Important folders
418 (defcustom wl-default-folder "%inbox"
419   "*Default folder used in `wl-summary-goto-folder'."
420   :type 'string
421   :group 'wl)
422 (defcustom wl-draft-folder "+draft"
423   "*Draft folder"
424   :type 'string
425   :group 'wl)
426 (defcustom wl-trash-folder "+trash"
427   "*Trash folder"
428   :type 'string
429   :group 'wl
430   :group 'wl-setting)
431 (defcustom wl-queue-folder "+queue"
432   "*Queue folder"
433   :type 'string
434   :group 'wl)
435
436 (defcustom wl-default-spec "%"
437   "*Default prefix for folder name initially added in minibuffer"
438   :type 'string
439   :group 'wl)
440
441 (defcustom wl-insert-mail-followup-to nil
442   "*Insert Mail-Followup-To: field if non-nil."
443   :type 'boolean
444   :group 'wl-draft)
445
446 (defcustom wl-insert-mail-reply-to nil
447   "*Insert Mail-Reply-To: field if non-nil."
448   :type 'boolean
449   :group 'wl-draft)
450
451 (defcustom wl-insert-message-id t
452   "*Insert Message-ID: field if non-nil."
453   :type 'boolean
454   :group 'wl-draft)
455
456 (defcustom wl-auto-insert-x-face t
457   "*Insert X-Face: field automatically."
458   :type 'boolean
459   :group 'wl-draft)
460
461 (defcustom wl-x-face-file "~/.xface"
462   "*X-Face field is inserted using its contents.
463 If file exists and `wl-auto-insert-x-face' is non-nil."
464   :type 'file
465   :group 'wl-draft)
466
467 (defcustom wl-draft-write-file-function 'wl-draft-save
468   "Save function for draft message."
469   :type 'function
470   :group 'wl-draft)
471
472 (defcustom wl-subscribed-mailing-list nil
473   "*Subscribed mailing list.
474 You had better set this variable if you set 'wl-insert-mail-followup-to' as t."
475   :type '(repeat string)
476   :group 'wl-pref
477   :group 'wl-setting)
478
479 (defcustom wl-demo t
480   "*Display demo at start time."
481   :type 'boolean
482   :group 'wl-pref)
483
484 (defcustom wl-demo-icon-name-alist
485   '(((string-match "^... Dec \\([ 01][0-9]\\|2[0-5]\\)" (current-time-string))
486      .
487      (concat "wl-" (wl-version-status) "-xmas-logo"))
488     (t
489      .
490      (concat "wl-" (wl-version-status) "-logo")))
491   "An alist to determine the basename of the logo file."
492   :type '(repeat (cons (symbol :tag "condition")
493                        (symbol :tag "file name")))
494   :group 'wl-pref)
495
496 (defcustom wl-demo-image-filter-alist nil
497   "An alist of image type and filter function."
498   :type '(repeat (cons symbol function))
499   :group 'wl-pref)
500
501 (defcustom wl-envelope-from nil
502   "*Envelope From used in SMTP.
503 If nil, `wl-from' is used."
504   :type '(choice (const :tag "Same as 'From' field." nil)
505                  string)
506   :group 'wl
507   :group 'wl-setting)
508
509 (defcustom wl-draft-additional-header-alist nil
510   "*Additional headers in the draft."
511   :type '(repeat (cons (symbol :tag "Field Name")
512                        (choice (string :tag "String")
513                                (function :tag "Function")))))
514
515 (defcustom wl-draft-add-in-reply-to t
516   "*If non-nil, message-id of the cited message is inserted to the
517 in-reply-to field of the current draft."
518   :type 'boolean
519   :group 'wl)
520
521 (defcustom wl-draft-add-references nil
522   "*If non-nil, message-id of the cited message is inserted to the
523 references field of the current draft."
524   :type 'boolean
525   :group 'wl)
526
527 (defcustom wl-draft-cite-function 'wl-default-draft-cite
528   "*A function for citation."
529   :type 'function
530   :group 'wl-draft)
531
532 (defcustom wl-default-draft-cite-decorate-author t
533   "*If non-nil, the author of cited message is arranged by
534 `wl-summary-from-func-internal' in `wl-default-draft-cite'."
535   :type 'boolean
536   :group 'wl-draft)
537
538 (defcustom wl-smtp-connection-type nil
539   "*SMTP connection type.
540 If nil, default smtp connection type is used."
541   :type '(choice (const :tag "default" nil)
542                  (const :tag "Use STARTTLS" starttls)
543                  (const :tag "SMTP over SSL" ssl)
544                  symbol)
545   :group 'wl)
546
547 (defcustom wl-smtp-posting-user nil
548   "*SMTP authentication user."
549   :type '(choice (const :tag "none" nil)
550                  string)
551   :group 'wl
552   :group 'wl-setting)
553
554 (defcustom wl-smtp-posting-server nil
555   "*SMTP server name to send mail (wl-draft-send-mail-with-smtp)."
556   :type '(choice (const :tag "none" nil)
557                  string)
558   :group 'wl
559   :group 'wl-setting)
560
561 (defcustom wl-smtp-posting-port nil
562   "*SMTP port number in `wl-smtp-posting-server'.
563 If nil, default SMTP port number(25) is used."
564   :type '(choice (const :tag "Default (25)" nil)
565                  integer)
566   :group 'wl
567   :group 'wl-setting)
568
569 (defcustom wl-smtp-authenticate-type nil
570   "*SMTP Authentication type.
571 If nil, don't authenticate."
572   :type '(choice (const :tag "none" nil)
573                  (const :tag "PLAIN" "plain")
574                  (const :tag "CRAM-MD5" "cram-md5")
575                  (const :tag "LOGIN" "login")
576                  (string :tag "Other"))
577   :group 'wl
578   :group 'wl-setting)
579
580 (defcustom wl-pop-before-smtp-user nil
581   "*POP3 user name to send mail using POP-before-SMTP.
582 If nil, `elmo-pop3-default-user' is used.
583 To use POP-before-SMTP,
584 \(setq wl-draft-send-mail-function 'wl-draft-send-mail-with-pop-before-smtp)"
585   :type '(choice (const :tag "none" nil)
586                  string)
587   :group 'wl
588   :group 'wl-setting)
589
590 (defcustom wl-pop-before-smtp-server nil
591   "*POP3 server for POP-before-SMTP.
592 If nil, `elmo-pop3-default-server' is used."
593   :type '(choice (const :tag "none" nil)
594                  string)
595   :group 'wl
596   :group 'wl-setting)
597
598 (defcustom wl-pop-before-smtp-port nil
599   "*POP3 port for POP-before-SMTP.
600 If nil, `elmo-pop3-default-port' is used."
601   :type '(choice (const :tag "none" nil)
602                  integer string)
603   :group 'wl
604   :group 'wl-setting)
605
606 (defcustom wl-pop-before-smtp-stream-type nil
607   "*Stream type for POP-before-SMTP.
608 If nil, `elmo-pop3-default-stream-type' is used."
609   :type 'boolean
610   :group 'wl)
611
612 (defcustom wl-pop-before-smtp-authenticate-type nil
613   "*Default Authentication type for POP-before-SMTP.
614 If nil, `elmo-pop3-default-authenticate-type' is used."
615   :type '(choice (const :tag "none" nil)
616                  (const :tag "APOP" 'apop)
617                  (const :tag "POP3" 'user))
618   :group 'wl
619   :group 'wl-setting)
620
621 (defcustom wl-nntp-posting-server nil
622   "*NNTP server name to post news.
623 If nil, `elmo-nntp-default-server' is used."
624   :type '(choice (const :tag "none" nil)
625                  string)
626   :group 'wl
627   :group 'wl-setting)
628 (defcustom wl-nntp-posting-user nil
629   "*NNTP user name to post news for authinfo.
630 If nil, `elmo-nntp-default-user' is used.
631 If nil, don't authenticate."
632   :type '(choice (const :tag "none" nil)
633                  string)
634   :group 'wl
635   :group 'wl-setting)
636 (defcustom wl-nntp-posting-port nil
637   "*NNTP port to post news.
638 If nil, `elmo-nntp-default-port' is used."
639   :type '(choice (const :tag "none" nil)
640                  integer string)
641   :group 'wl
642   :group 'wl-setting)
643 (defcustom wl-nntp-posting-stream-type nil
644   "*Stream type for posting Netnews.
645 If nil, `elmo-nntp-default-stream-type' is used."
646   :type 'boolean
647   :group 'wl)
648 (defcustom wl-nntp-posting-function 'elmo-nntp-post
649   "A function to post news.
650 Prepared candidate is 'elmo-nntp-post."
651   :type '(radio (function-item elmo-nntp-post)
652                 (function :tag "Other"))
653   :group 'wl-draft)
654 (defcustom wl-nntp-posting-config-alist nil
655   "*Alist of configuration on nntp posting.
656 ex.
657 '((\",?local.test\" . \"news.media.kyoto-u.ac.jp\")
658   (\",?ku\\.\" .
659    ((server . \"news.media.kyoto-u.ac.jp\")
660     (user . \"newsmaster\")
661     (port . 119)
662     (function . elmo-nntp-post))
663   (\".*\" . \"newsfeed.kuee.kyoto-u.ac.jp\")))"
664   :type '(repeat (cons (sexp :tag "Match")
665                        (choice (string :tag "Server")
666                                (repeat :inlie t
667                                        (cons (choice (const server)
668                                                      (const user)
669                                                      (const port)
670                                                      (const stream-type)
671                                                      (const function))
672                                              (sexp :tag "Value"))))))
673   :group 'wl-draft
674   :group 'wl-setting)
675
676 (defcustom wl-prefetch-confirm t
677   "*Confirm prefetching if message size is larger than `wl-prefetch-threshold'."
678   :type 'boolean
679   :group 'wl-pref)
680
681 (defcustom wl-prefetch-threshold 30000
682   "*Maximum size of message prefetched without confirmation.
683 If nil, all messages prefetched regardless of its size.
684 If message size is larger than this value, confirm prefetching
685 when `wl-prefetch-confirm' is non-nil."
686   :type '(choice (integer :tag "Threshold (bytes)")
687                  (const :tag "No limitation" nil))
688   :group 'wl-pref
689   :group 'wl-setting)
690
691 (defcustom wl-thread-insert-opened nil
692   "*Non-nil forces to insert thread as opened in updating."
693   :type 'boolean
694   :group 'wl-summary
695   :group 'wl-setting)
696
697 (defcustom wl-thread-open-reading-thread t
698   "*Non-nil forces to open reading thread."
699   :type 'boolean
700   :group 'wl-summary)
701
702 ;;;; Hooks
703 (defvar wl-folder-mode-hook nil
704   "A hook called when wanderlust folder mode is started.
705 This hook may contain the functions `wl-folder-init-icons' and
706 `wl-setup-folder' for reasons of system internal to accord facilities
707 for the Emacs variants.")
708 (defvar wl-summary-toggle-disp-on-hook nil
709   "A hook called when message is toggled.")
710 (defvar wl-summary-toggle-disp-off-hook nil
711   "A hook called when message is disappeared.")
712 (defvar wl-summary-toggle-disp-folder-on-hook nil
713   "A hook called when folder is toggled.")
714 (defvar wl-summary-toggle-disp-folder-off-hook nil
715   "A hook called when folder is disappeared.")
716 (defvar wl-summary-toggle-disp-folder-message-resumed-hook nil
717   "A hook called when message window is resumed when folder is toggled.")
718 (defvar wl-summary-mode-hook nil
719   "A hook called when summary mode is started.
720 This hook may contain the function `wl-setup-summary' for reasons of
721 system internal to accord facilities for the Emacs variants.")
722
723 (defvar wl-summary-prepared-pre-hook nil
724   "A hook called before the summary buffer has been generated.")
725 (defvar wl-summary-prepared-hook nil
726   "A hook called after the summary buffer has been generated.")
727 (defvar wl-summary-sync-updated-hook nil
728   "A hook called when update summary buffer.")
729 (defvar wl-summary-unread-message-hook nil
730   "A hook called when unread message is displayed.")
731 (defvar wl-summary-edit-addresses-hook nil
732   "A hook called when address book is edited.")
733 (defvar wl-summary-buffer-message-saved-hook nil
734   "A hook called when msgdb is saved.")
735 (defvar wl-summary-buffer-mark-saved-hook nil
736   "A hook called when mark is saved.")
737 (defvar wl-summary-divide-thread-when-subject-changed nil
738   "Divide thread when subject is changed.")
739 (defvar wl-init-hook nil
740   "A hook called when initialization is finished.  This hook may contain
741 the functions `wl-plugged-init-icons' and `wl-biff-init-icons' for
742 reasons of system internal to accord facilities for the Emacs variants.")
743 (defvar wl-hook nil
744   "A hook called when Wanderlust is invoked.")
745 (defvar wl-reply-hook nil
746   "A hook called when replied.")
747 (defvar wl-mail-setup-hook nil
748   "A hook called when Draft is prepared.")
749 (defvar wl-draft-reedit-hook '(wl-draft-remove-text-plain-tag)
750   "A hook called when Draft is re-edited.
751 The cursor point is located at top of the body.")
752 (defvar wl-draft-send-hook '(wl-draft-config-exec)
753   "A hook called on the draft editing buffer before sending process starts.")
754 (defvar wl-mail-send-pre-hook nil
755   "A hook called just before the mail sending process starts.")
756 (defvar wl-news-send-pre-hook nil
757   "A hook called just before the news sending process starts.")
758 (defvar wl-message-buffer-created-hook nil
759   "A hook called when Message buffer is prepared.")
760 (defvar wl-message-redisplay-hook nil
761   "A hook called when Message is displayed.")
762 (defvar wl-message-exit-hook nil
763   "A hook called when quit message.")
764 (defvar wl-summary-exit-pre-hook nil
765   "A hook called before exit summary mode.")
766 (defvar wl-summary-exit-hook nil
767   "A hook called when exit summary mode.")
768 (defvar wl-highlight-headers-hook nil
769   "A hook called when header is highlighted.")
770 (defvar wl-highlight-message-hook nil
771   "A hook called when message is highlighted.")
772 (defvar wl-save-hook nil
773   "A hook called when save summary and folder status.")
774 (defvar wl-exit-hook nil
775   "A hook called when exit wanderlust.")
776 (defvar wl-folder-suspend-hook nil
777   "A hook called when suspend wanderlust.")
778 (defvar wl-biff-notify-hook '(ding)
779   "A hook called when a biff-notification is invoked.")
780 (defvar wl-biff-unnotify-hook nil
781   "A hook called when a biff-notification is removed.")
782 (defvar wl-auto-check-folder-pre-hook nil
783   "A hook called before auto check folders.")
784 (defvar wl-auto-check-folder-hook nil
785   "A hook called when auto check folders.")
786 (defvar wl-folder-check-entity-pre-hook nil
787   "A hook called before check entity.")
788 (defvar wl-folder-check-entity-hook nil
789   "A hook called when check entity.")
790 (defvar wl-draft-config-exec-hook nil
791   "A hook called when execute header-config on draft.")
792 (defvar wl-summary-expire-pre-hook nil
793   "A hook called before expire.")
794 (defvar wl-summary-expire-hook nil
795   "A hook called when expired.")
796 (defvar wl-summary-archive-pre-hook nil
797   "A hook called before archive.")
798 (defvar wl-summary-archive-hook nil
799   "A hook called when archived.")
800 (defvar wl-summary-line-inserted-hook nil
801   "A hook called when summary line is inserted.")
802 (defvar wl-summary-insert-headers-hook nil
803   "A hook called when insert header for search header.")
804 (defvar wl-message-display-internal-hook nil
805   "A hook called when message buffer is created and message is displayed.
806 This hook may contain the functions `wl-setup-message' for
807 reasons of system internal to accord facilities for the Emacs variants.")
808 (defvar wl-thread-update-children-number-hook nil
809   "A hook called when children number is updated.")
810 (defvar wl-folder-update-access-group-hook nil
811   "A hook called when update access group folder.")
812 (defvar wl-draft-cited-hook nil
813   "A hook called after a message is cited.")
814 (defvar wl-draft-insert-x-face-field-hook nil
815   "A hook called after a x-face field is inserted.")
816 (defvar wl-template-mode-hook nil
817   "A hook called when template mode is started.")
818 (defvar wl-score-mode-hook nil
819   "A hook called when score mode is started.")
820 (defvar wl-make-plugged-hook nil
821   "A hook called when make plugged alist.")
822
823 (defvar wl-plugged-exit-hook nil
824   "A hook called when exit plugged mode.")
825
826 ;;;; functions for draft
827 (defcustom wl-draft-send-function 'wl-draft-normal-send-func
828   "A function to send message."
829   :type 'function
830   :group 'wl-draft)
831
832 (defcustom wl-draft-send-news-function 'wl-draft-elmo-nntp-send
833   "A function to send news."
834   :type 'function
835   :group 'wl-draft)
836
837 (defcustom wl-draft-send-mail-function 'wl-draft-send-mail-with-smtp
838   "A function to send mail.
839 Prepared candidates are 'wl-draft-send-mail-with-smtp,
840 'wl-draft-send-mail-with-qmail and 'wl-draft-send-mail-with-pop-before-smtp."
841   :type '(radio (function-item wl-draft-send-mail-with-smtp)
842                 (function-item wl-draft-send-mail-with-qmail)
843                 (function-item wl-draft-send-mail-with-pop-before-smtp)
844                 (function :tag "Other"))
845   :group 'wl-draft)
846
847 (defcustom wl-draft-reply-with-argument-list
848   '(("From" . (("Reply-To" "Mail-Reply-To" "From")
849                ("Mail-Followup-To" "To" "Cc")
850                ("Followup-To" "Newsgroups"))))
851   "Alist of cons cell of
852 \('field-name' .  ('fields for To' 'fields for Cc' 'fields for Newsgroups'))
853 'field-name' is a string.
854 'fields for ***' is a list of strings.
855 If car of each cons cell exists in original message,
856 cdr of each cons cell is used for draft message.
857 Default is for 'reply-to-all'."
858   :type '(repeat (cons (choice (string :tag "Field Name")
859                                (repeat (string :tag "Field Name")))
860                        (list (repeat :tag "Fields For To" string)
861                              (repeat :tag "Fields For Cc" string)
862                              (repeat :tag "Fields For Newsgroups" string))))
863   :group 'wl-draft)
864
865 (defcustom wl-draft-reply-without-argument-list
866   '(("Followup-To" . (("Mail-Followup-To" "Mail-Reply-To" "Reply-To") nil ("Followup-To")))
867     ("Mail-Followup-To" . (("Mail-Followup-To") nil nil))
868     ("Newsgroups" . (("Mail-Reply-To" "Reply-To" "To") ("Cc") ("Newsgroups")))
869     ("Mail-Reply-To" . (("Mail-Reply-To" "Reply-To") ("To" "Cc") nil))
870     ("Reply-To" . (("Reply-To") ("To" "Cc") nil))
871     (wl-draft-self-reply-p . (("To") ("Cc") nil))
872     ("From" . (("From") ("To" "Cc") nil)))
873   "Alist of cons cell of
874 \('field-name' .  ('fields for To' 'fields for Cc' 'fields for Newsgroups'))
875 'field-name' is a string.
876 'fields for ***' is a list of strings.
877 If car of each cons cell exists in original message,
878 cdr of each cons cell is used for draft message."
879   :type '(repeat (cons (choice (string :tag "Field Name")
880                                (repeat (string :tag "Field Name")))
881                        (list (repeat :tag "Fields For To" string)
882                              (repeat :tag "Fields For Cc" string)
883                              (repeat :tag "Fields For Newsgroups" string))))
884   :group 'wl-draft)
885
886 (defcustom wl-draft-always-delete-myself nil
887   "*Always delete myself from recipient if non-nil."
888   :type 'boolean
889   :group 'wl-draft)
890
891 (defcustom wl-draft-delete-myself-from-bcc-fcc nil
892   "*Do not insert bcc or fcc if To and Cc fields is a member of
893 `wl-subscribed-mailing-list'"
894   :type 'boolean
895   :group 'wl-draft)
896
897 (defcustom wl-draft-resume-folder-window t
898   "*Resume folder window in `wl-draft-hide'."
899   :type 'boolean
900   :group 'wl-draft)
901
902 (defcustom wl-draft-use-frame nil
903   "*Raise new frame when composing draft."
904   :type 'boolean
905   :group 'wl-draft)
906
907 (defcustom wl-draft-qmail-send-plugged nil
908   "*Send mail when plugged is on, in the `wl-draft-send-mail-with-qmail'."
909   :type 'boolean
910   :group 'wl-draft)
911
912 (defcustom wl-draft-remove-group-list-contents t
913   "*If non-nil, remove group list contents in `wl-draft-send-mail-with-smtp'."
914   :type 'boolean
915   :group 'wl-draft)
916
917 ;;;;
918 (defcustom wl-init-file "~/.wl"
919   "*User customization setting file."
920   :type 'file
921   :group 'wl)
922
923 (defcustom wl-folders-file "~/.folders"
924   "*Folders file."
925   :type 'file
926   :group 'wl)
927
928 (defcustom wl-address-file "~/.addresses"
929   "*Addresses file."
930   :type 'file
931   :group 'wl)
932
933 (defcustom wl-alias-file "~/.im/Aliases"
934   "*Alias file for completion."
935   :type 'file
936   :group 'wl)
937
938 (defcustom wl-ldap-server nil
939   "*LDAP server."
940   :type '(choice (const :tag "Default server(localhost)" nil)
941                  (string :tag "Server"))
942   :group 'wl
943   :group 'wl-setting)
944
945 (defcustom wl-ldap-port nil
946   "*LDAP port."
947   :type '(choice (const :tag "Default port" nil)
948                  integer)
949   :group 'wl
950   :group 'wl-setting)
951
952 (defcustom wl-ldap-base nil
953   "*LDAP base."
954   :type '(choice (const :tag "Default base" nil)
955                  (string :tag "Base"))
956   :group 'wl
957   :group 'wl-setting)
958
959 (defcustom wl-use-ldap nil
960   "*If non-nil, use LDAP for address completion."
961   :type 'boolean
962   :group 'wl
963   :group 'wl-setting)
964
965 (defcustom wl-use-acap nil
966   "*If non-nil, use ACAP for configuration."
967   :type 'boolean
968   :group 'wl)
969
970 (defcustom wl-folder-info-save t
971   "If non-nil, save elmo-folder-info-alist."
972   :type 'boolean
973   :group 'wl-folder)
974
975 (defcustom wl-summary-persistent-mark-priority-list '(flag
976                                                       new
977                                                       answered
978                                                       unread)
979   "List of flags reflected with the priority to persistent marks and faces."
980   :type '(repeat (radio (const :format "%v " new)
981                         (const :format "%v " flag)
982                         (const :format "%v " answered)
983                         (const :format "%v " unread)))
984   :group 'wl-summary)
985
986 (defcustom wl-summary-flag-alist
987   '((important "orange"))
988   "An alist to define the flags for the summary mode.
989 Each element is a form like:
990 \(SYMBOL-OF-FLAG COLOR\)
991 Example:
992 \((important \"orange\"\)
993  \(todo \"red\"\)
994  \(business \"green\"\)
995  \(private \"blue\"\)\)"
996   :type '(repeat (list (symbol :tag "flag")
997                        (string :tag "color")))
998   :group 'wl-summary)
999
1000 (defcustom wl-summary-new-uncached-mark "N"
1001   "Mark for new and uncached message."
1002   :type '(string :tag "Mark")
1003   :group 'wl-summary-marks)
1004
1005 (defcustom wl-summary-new-cached-mark "?"
1006   "Mark for new but already cached message."
1007   :type '(string :tag "Mark")
1008   :group 'wl-summary-marks)
1009
1010 (defcustom wl-summary-unread-uncached-mark "U"
1011   "Mark for unread and uncached message."
1012   :type '(string :tag "Mark")
1013   :group 'wl-summary-marks)
1014
1015 (defcustom wl-summary-unread-cached-mark "!"
1016   "Mark for unread but already cached message."
1017   :type '(string :tag "Mark")
1018   :group 'wl-summary-marks)
1019
1020 (defcustom wl-summary-read-uncached-mark "u"
1021   "Mark for read but uncached message."
1022   :type '(string :tag "Mark")
1023   :group 'wl-summary-marks)
1024
1025 (defcustom wl-summary-answered-cached-mark "&"
1026   "Mark for answered and cached message."
1027   :type '(string :tag "Mark")
1028   :group 'wl-summary-marks)
1029
1030 (defcustom wl-summary-answered-uncached-mark "A"
1031   "Mark for answered but cached message."
1032   :type '(string :tag "Mark")
1033   :group 'wl-summary-marks)
1034
1035 (defcustom wl-summary-flag-mark "$"
1036   "Mark for the messages which have tags."
1037   :type '(string :tag "Mark")
1038   :group 'wl-summary-marks)
1039
1040 (defcustom wl-summary-score-over-mark "+"
1041   "Score mark used for messages with high scores."
1042   :type '(string :tag "Mark")
1043   :group 'wl-summary-marks)
1044
1045 (defcustom wl-summary-score-below-mark "-"
1046   "Score mark used for messages with low scores."
1047   :type '(string :tag "Mark")
1048   :group 'wl-summary-marks)
1049
1050 (defcustom wl-summary-no-mime-folder-list nil
1051   "*All folders that match this list don't analysis mime."
1052   :type '(repeat string)
1053   :group 'wl-summary)
1054
1055 (defcustom wl-summary-fix-timezone nil
1056   "*Time zone of the date string in summary mode.
1057 If nil, it is adjust to the default time zone information
1058 \(system's default time zone or environment variable TZ)."
1059   :type '(choice (const :tag "Default time zone" nil)
1060                  string)
1061   :group 'wl-summary)
1062
1063 (defcustom wl-summary-default-score 0
1064   "*Default message score level.
1065 All scores generated by the score files will be added to this score.
1066 If this variable is nil, scoring will be disabled."
1067   :type '(choice (const :tag "disable" nil)
1068                  integer)
1069   :group 'wl-score)
1070
1071 (defcustom wl-summary-important-above nil
1072   "*Mark all messages with a score above this variable as important.
1073 This variable is local to the summary buffers."
1074   :type '(choice (const :tag "off" nil)
1075                  integer)
1076   :group 'wl-score)
1077
1078 (defcustom wl-summary-target-above nil
1079   "*Mark all messages with a score above this variable as target.
1080 This variable is local to the summary buffers."
1081   :type '(choice (const :tag "off" nil)
1082                  integer)
1083   :group 'wl-score)
1084
1085 (defcustom wl-summary-mark-below 0
1086   "*Mark all messages with a score below this variable as read.
1087 This variable is local to each summary buffer and usually set by the
1088 score file."
1089   :type 'integer
1090   :group 'wl-score)
1091
1092 (defcustom wl-summary-expunge-below nil
1093   "All messages that have a score less than this variable will be expunged.
1094 This variable is local to the summary buffers."
1095   :type '(choice (const :tag "off" nil)
1096                  integer)
1097   :group 'wl-score)
1098
1099 (defcustom wl-summary-score-marks
1100   (list wl-summary-new-uncached-mark wl-summary-new-cached-mark)
1101   "Persistent marks to scoring."
1102   :type '(repeat (string :tag "Mark"))
1103   :group 'wl-score)
1104
1105 (defcustom wl-use-scoring t
1106   "*If non-nil, enable scoring."
1107   :type 'boolean
1108   :group 'wl-pref)
1109
1110 (defcustom wl-summary-rescore-partial-threshold 200
1111   "*Summary is not scored entirely if there are messages more than this value.
1112 In sync-all or rescan."
1113   :type 'integer
1114   :group 'wl-score)
1115
1116 (defcustom wl-score-files-directory (concat elmo-msgdb-directory elmo-path-sep)
1117   "*Name of the directory where score files will be stored.
1118 (default \"~/.elmo\")."
1119   :type 'directory
1120   :group 'wl)
1121
1122 (defcustom wl-score-interactive-default-score 1000
1123   "*Scoring commands will raise/lower the score with this number as the default."
1124   :type 'integer
1125   :group 'wl-score)
1126
1127 (defcustom wl-score-expiry-days 7
1128   "*Number of days before unused score file entries are expired.
1129 If this variable is nil, no score file entries will be expired."
1130   :type '(choice (const :tag "never" nil)
1131                  number)
1132   :group 'wl-score)
1133
1134 (defcustom wl-score-update-entry-dates t
1135   "*In non-nil, update matching score entry dates.
1136 If this variable is nil, then score entries that provide matches
1137 will be expired along with non-matching score entries."
1138   :type 'boolean
1139   :group 'wl-score)
1140
1141 (defcustom wl-score-folder-alist nil
1142   "*Alist of folder regexp and score file."
1143   :type '(repeat (list (regexp :tag "Folder Regexp")
1144                        (repeat :inline t
1145                                (choice file
1146                                        (symbol :tag "Variable")))))
1147   :group 'wl-score)
1148
1149 (defcustom wl-score-folder-alist-matchone t
1150   "*If non-nil, getting only one element of `wl-score-folder-alist'."
1151   :type 'boolean
1152   :group 'wl-score)
1153
1154 (defcustom wl-score-default-file "all.SCORE"
1155   "*Default score file name."
1156   :type 'file
1157   :group 'wl-score)
1158
1159 (defcustom wl-score-simplify-fuzzy-regexp
1160   '("^[ \t]*\\[[^:]+[,: ][0-9]+\\][ \t]*")
1161   "*Strings to be removed when doing fuzzy matches.
1162 This can either be a regular expression or list of regular expressions."
1163   :type '(repeat regexp)
1164   :group 'wl-score)
1165
1166 (defcustom wl-score-header-default-entry
1167   '(("number" -1000 perm =)
1168     ("subject" -1000 nil nil)
1169     ("from" -1000 perm s)
1170     ("message-id" -1000 temp e)
1171     ("references" -1000 perm e)
1172     ("to" -1000 perm s)
1173     ("cc" -1000 perm s)
1174     ("date" -1000 temp nil)
1175     ("xref" -1000 perm s)
1176     ("extra" -1000 perm s)
1177     ("chars" -1000 perm >)
1178     ("lines" -1000 perm >)
1179     ("followup" -1000 perm s)
1180     ("thread" -1000 temp s))
1181   "*Default entry when insert score entry."
1182   :type '(repeat (list (string :tag "Header")
1183                        (choice (integer :tag "Score")
1184                                (const :tag "Ask" nil))
1185                        (choice (const :tag "Permanent" perm)
1186                                (const :tag "Temporary" temp)
1187                                (const :tag "Ask" nil))
1188                        (choice (const :tag "Regexp string" r)
1189                                (const :tag "Substring" s)
1190                                (const :tag "fuzzy string" f)
1191                                (const :tag "Exact string" e)
1192                                (const :tag "REGEXP STRING" R)
1193                                (const :tag "SUBSTRING" S)
1194                                (const :tag "FUZZY STRING" F)
1195                                (const :tag "EXACT STRING" E)
1196                                (const :tag "less than" <)
1197                                (const :tag "less equal" <=)
1198                                (const :tag "greater than" >)
1199                                (const :tag "greater equal" >=)
1200                                (const :tag "equal" =)
1201                                (const :tag "Ask" nil))))
1202   :group 'wl-score)
1203
1204 (defcustom wl-score-mode-mime-charset 'x-ctext
1205   "*MIME Charset for score file."
1206   :type 'symbol
1207   :group 'wl-score)
1208
1209 (defcustom wl-draft-fields
1210   '("To:" "Cc:" "Bcc:" "Fcc:" "Distribution:" "Organization:"
1211     "Newsgroups:" "Followup-To:" "Mail-Followup-To:" "From:" "Reply-To:")
1212   "Fields used in draft mode."
1213   :type '(repeat (string :tag "Field"))
1214   :group 'wl-draft)
1215
1216 ;; MIME Bcc.
1217 (defcustom wl-draft-mime-bcc-field-name "Ecc"
1218   "Field name for MIME-encapsulated Bcc."
1219   :type '(string :tag "Field Name")
1220   :group 'wl-draft)
1221
1222 (defcustom wl-draft-mime-bcc-body nil
1223   "Body string for MIME-encapsulated Bcc.
1224 If nil, a string `This is a blind carbon copy.' is used."
1225   :type '(choice (const :tag "default" nil)
1226                  (string :tag "Body"))
1227   :group 'wl-draft)
1228
1229 (defcustom wl-draft-disable-bcc-for-mime-bcc t
1230   "Disable Bcc while MIME-encapsulated Bcc."
1231   :type 'boolean
1232   :group 'wl-draft)
1233
1234 (defcustom wl-draft-disable-fcc-for-mime-bcc t
1235   "Disable Fcc while MIME-encapsulated Bcc."
1236   :type 'boolean
1237   :group 'wl-draft)
1238
1239 (defcustom wl-draft-config-alist nil
1240   "Alist of condition and actions for dynamical draft modification.
1241 First element of each list is some condition for the draft buffer (regular
1242 expression for header or elisp expression) and remaining elements indicate
1243 actions.
1244 If the first element is `reply' keyword, the next element be the condition
1245 for the message being replied, and remaining elements are actions.
1246
1247 The configuration is applied when `wl-draft-config-exec' is called, or
1248 applied automatically before sending message.
1249
1250 ex.
1251 '((\"^To: .*wl@lists.airs.net\"
1252    (\"From\" . my-from-address-for-wl-list)
1253    (\"Organization\" . my-organization-for-wl-list))
1254   (reply
1255    \"^To: .*hogehoge@aaa.ne.jp\"
1256    (\"From\" . \"Alternative Address <hogehoge@aaa.ne.jp>\")
1257    my-draft-config-function-hogehoge))
1258
1259 See also variable `wl-draft-parent-folder'."
1260   :type '(repeat (list (sexp :tag "Match")
1261                        (repeat
1262                         :inline t
1263                         (choice (cons (sexp :tag "Field(Variable)")
1264                                       (sexp :tag "Value"))
1265                                 (sexp :tag "Function")))))
1266   :group 'wl-draft
1267   :group 'wl-setting)
1268
1269 (defcustom wl-draft-config-matchone nil
1270   "*If non-nil, applied only one element of `wl-draft-config-alist'."
1271   :type 'boolean
1272   :group 'wl-draft
1273   :group 'wl-setting)
1274
1275 (defcustom wl-draft-elide-ellipsis "\n[...]\n\n"
1276   "*The string which is inserted for elided text."
1277   :type 'string
1278   :group 'wl-draft)
1279
1280 (defcustom wl-template-alist nil
1281   "Alist of template.
1282 First element of each list is a string specifies the name of the template.
1283 Remaining elements indicate actions. The format of actions is same as that
1284 of `wl-draft-config-alist'."
1285   :type '(repeat (list (string :tag "Name")
1286                        (repeat
1287                         :inline t
1288                         (choice (cons (sexp :tag "Field(Variable)")
1289                                       (sexp :tag "Value"))
1290                                 (sexp :tag "Function")))))
1291   :group 'wl-draft
1292   :group 'wl-setting)
1293
1294 (defcustom wl-template-visible-select t
1295   "*If non-nil, select template with visible."
1296   :type 'boolean
1297   :group 'wl-draft)
1298
1299 (defcustom wl-template-confirm nil
1300   "*If non-nil, require your confirmation when selected template."
1301   :type 'boolean
1302   :group 'wl-draft)
1303
1304 (defcustom wl-template-buffer-lines 7
1305   "*Lines of template buffer."
1306   :type 'integer
1307   :group 'wl-draft)
1308
1309 ;; queued sending.
1310 (defcustom wl-draft-enable-queuing t
1311   "*Non-nil enables queued sending."
1312   :type 'boolean
1313   :group 'wl-draft
1314   :group 'wl-pref)
1315
1316 (defcustom wl-draft-force-queuing nil
1317   "*Non-nil forces queued sending for mail and news."
1318   :type 'boolean
1319   :group 'wl-draft
1320   :group 'wl-pref)
1321
1322 (defcustom wl-draft-force-queuing-mail nil
1323   "*Non-nil forces queued sending for mail."
1324   :type 'boolean
1325   :group 'wl-draft
1326   :group 'wl-pref)
1327
1328 (defcustom wl-draft-force-queuing-news nil
1329   "*Non-nil forces queued sending for news."
1330   :type 'boolean
1331   :group 'wl-draft
1332   :group 'wl-pref)
1333
1334 (defcustom wl-draft-use-cache nil
1335   "*If non-nil, sending message is cached."
1336   :type 'boolean
1337   :group 'wl-draft
1338   :group 'wl-pref)
1339
1340 (defcustom wl-auto-flush-queue t
1341   "*If non-nil, sending queue is flushed when network status is toggled."
1342   :type 'boolean
1343   :group 'wl-draft
1344   :group 'wl-pref)
1345
1346 (defcustom wl-draft-buffer-style 'full
1347   "Style of draft buffer except for `wl-summary-reply' and `wl-summary-forward'
1348 'keep is to use current window, 'full is to use full frame window and
1349 'split is to split current window.
1350 If it is a function, it is called with the draft buffer as an argument."
1351   :type '(choice (const :tag "Keep window" keep)
1352                  (const :tag "Split window" split)
1353                  (const :tag "Full window" full)
1354                  (sexp :tag "Use Function"))
1355   :group 'wl-draft)
1356
1357 (defcustom wl-draft-reply-buffer-style 'split
1358   "Style of draft buffer for `wl-summary-reply' and `wl-summary-forward'
1359 'keep is to use message buffer window, 'full is to use full frame window and
1360 'split is to split message buffer window.
1361 If it is a function, it is called with the draft buffer as an argument."
1362   :type '(choice (const :tag "Keep window" keep)
1363                  (const :tag "Split window" split)
1364                  (const :tag "Full window" full)
1365                  (sexp :tag "Use Function"))
1366   :group 'wl-draft)
1367
1368 (defcustom wl-draft-reply-default-position 'body
1369   "Begining position of reply buffer.
1370 'body means the top of body.
1371 'bottom means the bottom of body.
1372 'top means the top of header.
1373 \"To\", \"Newsgroups\", \"Subject\" means the position of the header field.
1374 You can also set it to a list of setting.
1375 "
1376   :type '(choice (repeat
1377                   (choice
1378                    (const :tag "Top of body" body)
1379                    (const :tag "Bottom of body" bottom)
1380                    (const :tag "Top of header" top)
1381                    (const "To")
1382                    (const "Newsgroups")
1383                    (const "Subject")
1384                    (string :tag "Header Name")))
1385                  (const "To")
1386                  (const "Newsgroups")
1387                  (const "Subject")
1388                  (string :tag "Header Name"))
1389   :group 'wl-draft)
1390
1391 (defcustom wl-draft-queue-save-variables
1392   '(wl-envelope-from wl-from
1393     wl-smtp-posting-server wl-smtp-posting-user wl-smtp-posting-port
1394     wl-smtp-authenticate-type wl-smtp-connection-type
1395     wl-pop-before-smtp-server wl-pop-before-smtp-user wl-pop-before-smtp-port
1396     wl-pop-before-smtp-stream-type wl-pop-before-smtp-authenticate-type
1397     wl-nntp-posting-server wl-nntp-posting-server
1398     wl-nntp-posting-user wl-nntp-posting-port wl-nntp-posting-stream-type)
1399   "*Saving variables in queue info."
1400   :type '(repeat (sexp :tag "Variable"))
1401   :group 'wl-draft)
1402
1403 (defcustom wl-draft-sendlog t
1404   "*Keep send state in log if non-nil."
1405   :type 'boolean
1406   :group 'wl-draft)
1407
1408 (defcustom wl-draft-sendlog-max-size 20000
1409   "*Max file size of sendlog."
1410   :type '(choice (const :tag "Unlimited" nil)
1411                  integer)
1412   :group 'wl-draft)
1413
1414 (defcustom wl-summary-default-number-column 5
1415   "Number of columns in summary buffer."
1416   :type 'integer
1417   :group 'wl-summary)
1418
1419 (defcustom wl-summary-number-column-alist '(("\\*.*" . 6))
1420   "Alist of folder and its number column.
1421 If no matches, 'wl-summary-default-number-column' is used.
1422 ex.
1423 '((\"^%inbox@qmail-maildir\" . 9)
1424   (\"^-.*@news-server\" . 6))"
1425   :type '(repeat (cons (regexp :tag "Folder Regexp") integer))
1426   :group 'wl-summary)
1427
1428 (defcustom wl-summary-highlight t
1429   "Non-nil forces Summary buffer to be highlighted."
1430   :type 'boolean
1431   :group 'wl-summary
1432   :group 'wl-highlight)
1433
1434 (defcustom wl-summary-lazy-highlight (boundp 'window-scroll-functions)
1435   "Non-nil forces lazy summary highlighting using `window-scroll-functions'."
1436   :type 'boolean
1437   :group 'wl-summary
1438   :group 'wl-highlight)
1439
1440 (defcustom wl-summary-highlight-partial-threshold 1000
1441   "Summary is not highlighted entirely if there are lines more than this value.
1442 Available if only `wl-summary-lazy-highlight' is nil."
1443   :type 'integer
1444   :group 'wl-summary
1445   :group 'wl-highlight)
1446
1447 (defcustom wl-summary-partial-highlight-above-lines 30
1448   "If Summary has lines more than `wl-summary-highlight-partial-threshold',
1449 Summary lines are highlighted partialy above current position.
1450 Available if only `wl-summary-lazy-highlight' is nil."
1451   :type 'integer
1452   :group 'wl-summary
1453   :group 'wl-highlight)
1454
1455 (defcustom wl-summary-lazy-update-mark (boundp 'window-scroll-functions)
1456   "Non-nil forces lazy update mark using `window-scroll-functions'."
1457   :type 'boolean
1458   :group 'wl-summary)
1459
1460 (defcustom wl-summary-cache-use t
1461   "Non-nil forces wl-summary to use cache file."
1462   :type 'boolean
1463   :group 'wl-summary)
1464
1465 (defcustom wl-summary-auto-sync-marks t
1466   "Non-nil forces to synchronize unread/important marks."
1467   :type 'boolean
1468   :group 'wl-summary)
1469
1470 (defcustom wl-summary-cache-file ".wl-summary-cache"
1471   "*Cache file for summary mode contents."
1472   :type 'file
1473   :group 'wl-summary)
1474 (defcustom wl-summary-view-file ".wl-summary-view"
1475   "*Current summary view."
1476   :type 'file
1477   :group 'wl-summary)
1478 (defcustom wl-thread-top-file ".wl-thread-top"
1479   "*Current thread top entity... obsolete."
1480   :type 'file
1481   :group 'wl-summary)
1482 (defcustom wl-thread-entity-file ".wl-thread-entity"
1483   "*Thread entities."
1484   :type 'file
1485   :group 'wl-summary)
1486 (defcustom wl-thread-entity-list-file ".wl-thread-entity-list"
1487   "*Thread top entity list."
1488   :type 'file
1489   :group 'wl-summary)
1490
1491 (defcustom wl-print-buffer-function 'lpr-buffer
1492   "A function to print current buffer."
1493   :type 'function
1494   :group 'wl-pref)
1495
1496 (defcustom wl-ps-print-buffer-function
1497   (if window-system 'ps-print-buffer-with-faces 'ps-print-buffer)
1498   "A function to print current buffer with ps-print."
1499   :type 'function
1500   :group 'wl-pref)
1501
1502 ;;;; Preferences
1503 (defcustom wl-use-petname t
1504   "*Display petname in summary and default citation title."
1505   :type 'boolean
1506   :group 'wl-pref)
1507
1508 (defcustom wl-use-folder-petname
1509   '(modeline)
1510   "*List of situation using folder petname.
1511 Allowed situations are:
1512   modeline    : displayed on modeline.
1513   ask-folder  : displayed on minibuffer when ask folder.
1514   read-folder : can used for completion at `wl-summary-read-folder'."
1515   :type '(set (const modeline)
1516               (const ask-folder)
1517               (const read-folder))
1518   :group 'wl-summary
1519   :group 'wl-pref)
1520
1521 (defcustom wl-folder-petname-alist nil
1522   "A list of (realname . petname)."
1523   :type '(repeat (cons (string :tag "Realname") (string :tag "Petname")))
1524   :group 'wl-folder)
1525
1526 (defcustom wl-summary-weekday-name-lang
1527   (if (and (boundp 'current-language-environment)
1528            (string-equal "Japanese"
1529                          (symbol-value 'current-language-environment)))
1530       "ja" "en")
1531   "*Language to display week day."
1532   :type '(choice (const "ja")
1533                  (const "en")
1534                  (const "fr")
1535                  (const "de")
1536                  (string :tag "Other"))
1537   :group 'wl-summary
1538   :group 'wl-pref)
1539
1540 (defcustom wl-message-id-use-wl-from t
1541   "*Use `wl-from' for domain part of Message-ID if non-nil."
1542   :type 'boolean
1543   :group 'wl-pref)
1544
1545 (defcustom wl-local-domain nil
1546   "*Domain part of this client (without hostname).
1547 Set this if (system-name) does not return FQDN."
1548   :type '(choice (const :tag "Use System Name" nil)
1549                  string)
1550   :group 'wl-pref)
1551
1552 (defcustom wl-message-id-domain nil
1553   "*Specific domain part of Message-ID."
1554   :type '(choice (const :tag "Use System Name" nil)
1555                  string)
1556   :group 'wl-pref)
1557
1558 (defcustom wl-unique-id-suffix ".wl"
1559   "*Specific string in generated Message-ID
1560 which appear just before @."
1561   :type 'string
1562   :group 'wl-pref)
1563
1564 (defcustom wl-break-pages t
1565   "*Break Pages at ^L."
1566   :type 'boolean
1567   :group 'wl-pref)
1568
1569 (defcustom wl-message-use-header-narrowing t
1570   "Use header narrowing when non-nil."
1571   :type 'boolean
1572   :group 'wl-pref)
1573
1574 (defcustom wl-message-header-narrowing-fields '("to" "cc")
1575   "A list of field name to enable header narrowing."
1576   :type '(repeat string)
1577   :group 'wl-pref)
1578
1579 (defcustom wl-message-header-narrowing-lines 4
1580   "Line number to enable the header narrowing."
1581   :type 'integer
1582   :group 'wl-pref)
1583
1584 (defcustom wl-message-header-narrowing-string "..."
1585   "A string used for header narrowing truncation."
1586   :type 'string
1587   :group 'wl-pref)
1588
1589 (defvar wl-message-mode-line-format-spec-alist
1590   '((?f (if (memq 'modeline wl-use-folder-petname)
1591             (wl-folder-get-petname wl-message-buffer-cur-folder)
1592           wl-message-buffer-cur-folder))
1593     (?F wl-message-buffer-flag-indicator)
1594     (?n wl-message-buffer-cur-number))
1595   "An alist of format specifications for message buffer's mode-lines.
1596 Each element is a list of following:
1597 \(SPEC STRING-EXP)
1598 SPEC is a character for format specification.
1599 STRING-EXP is an expression to get string to insert.")
1600
1601 (defcustom wl-message-mode-line-format "Wanderlust: << %f / %n %F>>"
1602   "*A format string for message buffer's mode-line of Wanderlust.
1603 It may include any of the following format specifications
1604 which are replaced by the given information:
1605
1606 %f The folder name.
1607 %n The number of the message.
1608 %F The global flag indicator."
1609   :group 'wl-pref
1610   :type 'string)
1611
1612 (defcustom wl-message-truncate-lines default-truncate-lines
1613   "*Truncate lines in Message Buffer."
1614   :type 'boolean
1615   :group 'wl-pref)
1616
1617 (defcustom wl-draft-truncate-lines default-truncate-lines
1618   "*Truncate lines in Draft Buffer."
1619   :type 'boolean
1620   :group 'wl-draft
1621   :group 'wl-pref)
1622
1623 (defcustom wl-message-scroll-amount nil
1624   "*Scroll amount by SPC key."
1625   :type '(choice (const :tag "scrolling by screenfuls" nil)
1626                  integer)
1627   :group 'wl-pref)
1628
1629 (defcustom wl-message-window-size '(1 . 4)
1630   "*Size of summary and message window.  cons cell of (Summary : Message)."
1631   :type '(cons integer integer)
1632   :group 'wl-pref)
1633
1634 (defcustom wl-message-sort-field-list '("Return-Path" "Received" "^To" "^Cc"
1635                                         "Newsgroups" "Subject" "^From")
1636   "*Sort order of header fields.  Each elements are regexp of field name."
1637   :type '(repeat (string :tag "Field Regexp"))
1638   :group 'wl-pref
1639   :group 'wl-setting)
1640
1641 (defcustom wl-message-ignored-field-list nil
1642   "All fields that match this list will be hidden in message buffer.
1643 Each elements are regexp of field-name.
1644 You can specify exceptions by `wl-message-visible-field-list'."
1645   :type '(repeat (string :tag "Field Regexp"))
1646   :group 'wl-pref
1647   :group 'wl-setting)
1648
1649 (defcustom wl-message-visible-field-list nil
1650   "All fields that match this list will be displayed in message buffer.
1651 Each elements are regexp of field-name.
1652 This variable overwhelm `wl-message-ignored-field-list' settings."
1653   :type '(repeat (string :tag "Field Regexp"))
1654   :group 'wl-pref
1655   :group 'wl-setting)
1656
1657 (defcustom wl-message-header-button-alist
1658   (` (("^\\(References\\|Message-Id\\|In-Reply-To\\):"
1659        "<[^>]+>"
1660        0 wl-message-button-refer-article  0)
1661       ("^[^:]+:"
1662        "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)"
1663        1 wl-message-button-refer-article 3)))
1664   "Alist of headers and regexps to match buttons in message headers."
1665   :type '(repeat
1666           (list (regexp :tag "Header")
1667                 regexp
1668                 (integer :tag "Button")
1669                 (function :tag "Callback")
1670                 (repeat :tag "Data"
1671                         :inline t
1672                         (integer :tag "Regexp group"))))
1673   :group 'wl-pref)
1674
1675 (defcustom wl-message-body-button-alist
1676   '(("<mailto:[^>]+>" 0 'ignore 0 1024)
1677     ("<[^>]+@[^>]+>" 0 wl-message-button-refer-article 0 1024))
1678   "Alist of regexps to match buttons in message body."
1679   :type '(repeat
1680           (list regexp
1681                 (integer :tag "Button")
1682                 (function :tag "Callback")
1683                 (repeat :tag "Data"
1684                         :inline t
1685                         (integer :tag "Regexp group"))
1686                 (integer :tag "Max Length")))
1687   :group 'wl-pref)
1688
1689 (defcustom wl-folder-window-width 20
1690   "*Width of folder window."
1691   :type 'integer
1692   :group 'wl-folder
1693   :group 'wl-pref)
1694
1695 (defcustom wl-summary-recenter t
1696   "*Recenter on redisplay."
1697   :type 'boolean
1698   :group 'wl-summary
1699   :group 'wl-pref)
1700
1701 (defcustom wl-folder-use-frame nil
1702   "*Use dedicated frame for folder mode if non-nil."
1703   :type 'boolean
1704   :group 'wl-pref)
1705
1706 (defcustom wl-summary-use-frame nil
1707   "*Use dedicated frame for each folder summary if non-nil."
1708   :type 'boolean
1709   :group 'wl-pref)
1710
1711 (defcustom wl-stay-folder-window nil
1712   "*Stay folder window when folder is selected if non-nil."
1713   :type 'boolean
1714   :group 'wl-pref)
1715
1716 (defcustom wl-reply-subject-prefix "Re: "
1717   "*Prefix of the subject of the replied message."
1718   :type 'string
1719   :group 'wl-draft
1720   :group 'wl-pref)
1721
1722 (defcustom wl-forward-subject-prefix "Forward: "
1723   "*Prefix of the subject of the forwarded message."
1724   :type 'string
1725   :group 'wl-draft
1726   :group 'wl-pref)
1727
1728 (defcustom wl-draft-reply-use-address-with-full-name t
1729   "*Use address with full-name in the draft of replied message."
1730   :type 'boolean
1731   :group 'wl-pref
1732   :group 'wl-draft)
1733
1734 (defcustom wl-subject-prefix-regexp "^[ \t]*\\([Rr][Ee][:>][ \t]*\\)*[ \t]*"
1735   "*Regexp matching \"Re: \" in the subject line."
1736   :type 'regexp
1737   :group 'wl-draft
1738   :group 'wl-pref)
1739
1740 (defcustom wl-folder-many-unsync-threshold 70
1741   "*Folders which contains messages more than this number are highlighted
1742 with wl-highlight-folder-many-face."
1743   :type 'integer
1744   :group 'wl-folder
1745   :group 'wl-pref)
1746
1747 (defcustom wl-fcc nil
1748   "*Folder Carbon Copy target initially added at creating draft buffer."
1749   :type '(choice (const :tag "disable" nil)
1750                  string function)
1751   :group 'wl-draft
1752   :group 'wl-pref)
1753
1754 (defcustom wl-fcc-force-as-read nil
1755   "*If non-nil, mark copied message as read."
1756   :type 'boolean
1757   :group 'wl-draft
1758   :group 'wl-pref)
1759
1760 (defcustom wl-bcc nil
1761   "*Blind Carbon Copy target initially added at creating draft buffer."
1762   :type '(choice (const :tag "disable" nil)
1763                  string)
1764   :group 'wl-draft
1765   :group 'wl-pref)
1766
1767 (defcustom wl-folder-desktop-name "Desktop"
1768   "*An implicit name of the folder top entity."
1769   :type 'string
1770   :group 'wl-folder
1771   :group 'wl-pref)
1772
1773 (defcustom wl-summary-indent-length-limit 46
1774   "*Limit of indent length for thread. Nil means unlimited"
1775   :type '(choice (const :tag "Unlimited" nil)
1776                  integer)
1777   :group 'wl-summary
1778   :group 'wl-pref)
1779
1780 (defcustom wl-summary-max-thread-depth 30
1781   "*If thread depth of the message is larger than this value, divide it."
1782   :type '(choice (const :tag "Unlimited" nil)
1783                  integer)
1784   :group 'wl-summary
1785   :group 'wl-pref)
1786
1787 (defcustom wl-summary-no-from-message "nobody@nowhere?"
1788   "*A string displayed in summary when no from field exists."
1789   :type 'string
1790   :group 'wl-summary)
1791
1792 (defcustom wl-summary-no-subject-message "(WL:No Subject in original.)"
1793   "*A string displayed in summary when no subject field exists."
1794   :type 'string
1795   :group 'wl-summary)
1796
1797 (defcustom wl-summary-cancel-message "I'd like to cancel my message."
1798   "*The body content of a cancel message."
1799   :type 'string
1800   :group 'wl-summary)
1801
1802 (defcustom wl-summary-width 80
1803   "*Set summary line width if non nil."
1804   :type '(choice (const :tag "Don't truncate" nil)
1805                  integer)
1806   :group 'wl-summary
1807   :group 'wl-pref)
1808
1809 (defcustom wl-summary-print-argument-within-window nil
1810   "*If non-nil, always print argument right side of window."
1811   :type 'boolean
1812   :group 'wl-summary
1813   :group 'wl-pref)
1814
1815 (defcustom wl-summary-pick-field-default "Body"
1816   "*Default field for pick."
1817   :type '(radio (const "From")
1818                 (const "Subject")
1819                 (const "To")
1820                 (const "Cc")
1821                 (const "Body")
1822                 (const "Since")
1823                 (const "Before")
1824                 (const "Last")
1825                 (const "First")
1826                 (string :tag "Other"))
1827   :group 'wl-summary)
1828
1829 (defcustom wl-mime-charset 'x-ctext
1830   "*MIME Charset for summary and message."
1831   :type 'symbol
1832   :group 'wl-summary
1833   :group 'wl-pref)
1834
1835 (defcustom wl-generate-mailer-string-function 'wl-generate-user-agent-string
1836   "A function for creating User-Agent field string."
1837   :type 'function
1838   :group 'wl-draft)
1839
1840 (defcustom wl-highlight-background-mode  (if (boundp 'hilit-background-mode)
1841                                              (or hilit-background-mode 'dark)
1842                                            'dark)
1843   "*Background mode of highlight (for Old Emacsen).  'dark or 'light."
1844   :type '(radio (const dark)
1845                 (const light))
1846   :group 'wl-highlight)
1847
1848 (defcustom wl-highlight-x-face-function nil
1849   "A function to display X-Face."
1850   :type 'function
1851   :group 'wl-highlight)
1852
1853 (defcustom wl-qmail-inject-program "/var/qmail/bin/qmail-inject"
1854   "Location of the qmail-inject program."
1855   :type '(string :tag "Program")
1856   :group 'wl-draft)
1857
1858 (defcustom wl-qmail-inject-args nil
1859   "Arguments passed to qmail-inject programs.
1860 This should be a list of strings, one string for each argument.
1861
1862 For e.g., if you wish to set the envelope sender address so that bounces
1863 go to the right place or to deal with listserv's usage of that address, you
1864 might set this variable to '(\"-f\" \"you@some.where\")."
1865   :type '(repeat (string :tag "Argument"))
1866   :group 'wl-draft)
1867
1868 (defcustom wl-rejected-letter-start
1869   "^[\t ]*-+[\t ]+\\(\\(original\\|\\(\\(the \\)?unsent\\)\\) message\\( follows\\)?[\t ]+-+[\t ]*\\|Below this line is a copy of the message\\..*\\)$"
1870   "Regexp specifying the beginning of the wrapper around a returned letter.
1871 This wrapper is generated by the mail system when rejecting a letter."
1872   :type 'regexp
1873   :group 'wl-draft)
1874
1875 (defcustom wl-ignored-forwarded-headers "\\(received\\|return-path\\|x-uidl\\)"
1876   "*All headers that match this regexp will be deleted when forwarding a message."
1877   :type 'regexp
1878   :group 'wl-draft)
1879
1880 (defcustom wl-ignored-resent-headers "\\(return-receipt\\|[bdf]cc\\)"
1881   "*All headers that match this regexp will be deleted when resending a message."
1882   :type 'regexp
1883   :group 'wl-draft)
1884
1885 (defcustom wl-draft-preview-attributes t
1886   "Non-nil forces to preview the attributes in the `wl-draft-preview-message'.
1887 Attributes specified in the `wl-draft-preview-attributes-list' are displayed."
1888   :type 'boolean
1889   :group 'wl-draft)
1890
1891 (defcustom wl-draft-preview-attributes-list '(recipients
1892                                               envelope-from
1893                                               smtp-posting-server
1894                                               smtp-posting-port)
1895   "*Attribute symbols to display in the draft preview.
1896 Candidates are following:
1897 `recipients'
1898 `envelope-from'
1899 `smtp-posting-server'
1900 `smtp-posting-port'
1901 `nntp-posting-server'
1902 `nntp-posting-port'
1903 Also variables which begin with `wl-' can be specified
1904 \(`wl-' have to be removed\)"
1905   :type '(repeat symbol)
1906   :group 'wl-draft)
1907
1908 (defcustom wl-draft-preview-attributes-buffer-lines 5
1909   "*Buffer height for the draft attribute preview."
1910   :type 'integer
1911   :group 'wl-draft)
1912
1913 (defcustom wl-draft-preview-attributes-buffer-name "*Preview Attributes*"
1914   "*Buffer name for the draft attribute preview."
1915   :type 'string
1916   :group 'wl-draft)
1917
1918 (defcustom wl-refile-default-from-folder "+from"
1919   "*Folder name to refile by `wl-refile-guess-by-from'."
1920   :type '(string :tag "Folder")
1921   :group 'wl-pref)
1922
1923 (defcustom wl-summary-auto-refile-skip-marks
1924   (list wl-summary-new-uncached-mark
1925         wl-summary-new-cached-mark
1926         wl-summary-unread-uncached-mark
1927         wl-summary-unread-cached-mark)
1928   "Persistent marks to skip auto-refiling."
1929   :type '(repeat (string :tag "Mark"))
1930   :group 'wl-summary)
1931
1932 (defcustom wl-summary-reserve-mark-list
1933   (list "o" "O" "D" "d" "i")
1934   "If a message is already marked as temporal marks in this list,
1935 the message is not marked by any mark command."
1936   :type '(repeat (string :tag "Temp-Mark"))
1937   :group 'wl-summary)
1938
1939 (defcustom wl-summary-skip-mark-list
1940   (list "D" "d")
1941   "If a message is already marked as temporal marks in this list,
1942 the message is skipped at cursor move."
1943   :type '(repeat (string :tag "Temp-Mark"))
1944   :group 'wl-summary)
1945
1946 (defcustom wl-summary-incorporate-marks
1947   (list wl-summary-new-uncached-mark
1948         wl-summary-unread-uncached-mark)
1949   "Persistent marks to prefetch at `wl-summary-incorporate'."
1950   :type '(repeat (string :tag "Mark"))
1951   :group 'wl-summary)
1952
1953 (defcustom wl-refile-rule-alist nil
1954   "Refile rule alist.
1955 e.x.
1956 '(
1957   (\"From\"
1958    (\"teranisi@isl.ntt.co.jp\" . \"+teranisi\"))
1959   (\"x-ml-name\"
1960    (\"^Wanderlust\"    . \"+wl\")
1961    (\"^Elips\" . \"+elips\")))"
1962   :type '(repeat (list (string :tag "Field")
1963                        (repeat :inline t
1964                                (cons (regexp :tag "Value")
1965                                      (string :tag "Folder")))))
1966   :group 'wl-pref)
1967
1968 (defcustom wl-strict-diff-folders nil
1969   "List of regexps matching folders of which Wanderlust seriously counts unsync messages."
1970   :type '(choice (const :tag "Off" nil)
1971                  (repeat (regexp :tag "Folder Regexp")))
1972   :group 'wl-folder)
1973
1974 (defcustom wl-folder-use-server-diff t
1975   "Checked unread message number on IMAP4 server.
1976 Only IMAP4 folders have an effect."
1977   :type 'boolean
1978   :group 'wl-folder)
1979
1980 (defcustom wl-force-fetch-folders nil
1981   "Non-nil forces to fetch subfolders when user opened an 'access' folder."
1982   :type '(choice (const :tag "off" nil)
1983                  (const :menu-tag "on" t)
1984                  (repeat (regexp :tag "Folder Regexp")))
1985   :group 'wl-folder)
1986
1987 (defcustom wl-auto-check-folder-name nil
1988   "*A folder, a group or a list of folders and groups specified which
1989 will be automatically checked at the startup time."
1990   :type '(choice (string :tag "Folder")
1991                  (repeat (string :tag "Folder"))
1992                  (const none))
1993   :group 'wl-folder)
1994
1995 (defcustom wl-auto-uncheck-folder-list '("\\$.*")
1996   "All folders that match this list won't be checked at the startup
1997 time even if they are embedded in some groups specified by
1998 wl-auto-check-folder-name.
1999 Those folders are also skipped when you check on the Desktop.
2000 This value is preceded by wl-auto-check-folder-list.
2001 Each elements are regexp of folder name."
2002   :type '(repeat (regexp :tag "Folder Regexp"))
2003   :group 'wl-folder)
2004
2005 (defcustom wl-auto-check-folder-list nil
2006   "A list of patterns for exceptional folders against
2007 wl-auto-uncheck-folder-list.
2008 Each elements are regexp of folder name."
2009   :type '(repeat (regexp :tag "Folder Regexp"))
2010   :group 'wl-folder)
2011
2012 (defcustom wl-show-plug-status-on-modeline t
2013   "If it is non-nil, show plugged status in modeline."
2014   :type 'boolean
2015   :group 'wl-highlight)
2016
2017 (defcustom wl-plug-state-indicator-on  " [ON] "
2018   "String used to show plugged status ON."
2019   :type 'string
2020   :group 'wl-highlight)
2021
2022 (defcustom wl-plug-state-indicator-off " [--] "
2023   "String used to show plugged status OFF."
2024   :type 'string
2025   :group 'wl-highlight)
2026
2027 (defcustom wl-biff-check-folder-list nil
2028   "All folders that match this list are automatically checked
2029 every intervals specified by wl-biff-check-interval."
2030   :type '(repeat (regexp :tag "Folder Regexp"))
2031   :group 'wl-highlight)
2032
2033 (defcustom wl-biff-check-interval 40
2034   "Number of seconds between updates of new mails in the mode line."
2035   :type 'integer
2036   :group 'wl-highlight)
2037
2038 (defcustom wl-biff-state-indicator-on (if (and (featurep 'xemacs)
2039                                                (not (featurep 'mule)))
2040                                           "[Mail]"
2041                                         (decode-coding-string
2042                                          ;; Youbin mark
2043                                          (read "\"[\e$B\\\")\e(B]\"")
2044                                          (if (boundp 'MULE)
2045                                              '*iso-2022-jp*
2046                                            'iso-2022-jp)))
2047   "String used to show biff status ON."
2048   :type 'string
2049   :group 'wl-highlight)
2050
2051 (defcustom wl-biff-state-indicator-off (if (and (featurep 'xemacs)
2052                                                 (not (featurep 'mule)))
2053                                            "[--]"
2054                                           ;; Japanese short hyphen
2055                                          "[\e$B!>\e(B]")
2056   "String used to show biff status OFF."
2057   :type 'string
2058   :group 'wl-highlight)
2059
2060 (defcustom wl-mode-line-display-priority-list '(biff plug title)
2061   "Displaying order of items to be shown in modeline.  The first item will
2062 be placed in the leftmost.  The significant items are `biff' and `plug';
2063 otherwise, e.g. `title', corresponds to the things except for the biff
2064 staus nor the plugged status.  The default order is '(biff plug title)
2065 even if the value of this option is set to nil.  Here are some samples:
2066
2067 ;; Plugged status first:
2068 \(setq wl-mode-line-display-priority-list '(plug))
2069
2070 ;; Biff status, Title of Wanderlust, Plugged status:
2071 \(setq wl-mode-line-display-priority-list '(biff title plug))
2072
2073 "
2074   :type '(repeat (radio (const :format "%v " biff)
2075                         (const :format "%v " plug)
2076                         (sexp :tag "Other" :value title)))
2077   :group 'wl-highlight)
2078
2079 (defcustom wl-interactive-send t
2080   "*If non-nil, require your confirmation when sending draft message."
2081   :type 'boolean
2082   :group 'wl-pref
2083   :group 'wl-setting)
2084
2085 (defcustom wl-interactive-exit t
2086   "*If non-nil, require your confirmation when exiting WL."
2087   :type 'boolean
2088   :group 'wl-pref)
2089
2090 (defcustom wl-summary-move-order 'unread
2091   "*The order of priority when move in summary mode.
2092 If this variable is `unread', precede \"U\", \"!\", \"N\" mark.
2093 If this variable is `new', precede \"N\" mark."
2094   :type '(radio (const new)
2095                 (const unread))
2096   :group 'wl-summary
2097   :group 'wl-setting)
2098
2099 (defvar wl-summary-move-direction-downward t)
2100
2101 (defcustom wl-summary-move-direction-toggle t
2102   "*If non-nil, search direction for the next message will be determined
2103 depends on previous search direction.
2104 It uses wl-summary-move-direction-downward as a direction flag."
2105   :type 'boolean
2106   :group 'wl-summary)
2107
2108 (defcustom wl-auto-select-first nil
2109   "*If non-nil, display selected first message when enter summary."
2110   :type 'boolean
2111   :group 'wl-pref
2112   :group 'wl-setting)
2113
2114 (defcustom wl-auto-prefetch-first nil
2115   "*If non-nil, prefetch selected first message when enter summary."
2116   :type 'boolean
2117   :group 'wl-pref
2118   :group 'wl-setting)
2119
2120 (defcustom wl-auto-select-next nil
2121   "*If non-nil, offer to go to the next folder from the end of the previous.
2122 If the value is the symbol `unread', go to the next folder
2123 that no unread message exists.  If the value is the symbol `skip-no-unread',
2124 skip the folder that no unread message exists.
2125
2126 See also variable `wl-summary-next-no-unread-command'."
2127   :type '(radio (const :tag "off" nil)
2128                 (const :tag "on" t)
2129                 (const unread)
2130                 (const skip-no-unread))
2131   :group 'wl-pref
2132   :group 'wl-setting)
2133
2134 (defcustom wl-message-buffer-name " *WL:Message*"
2135   "*Buffer name for message buffers."
2136   :group 'wl-pref
2137   :group 'wl-setting)
2138
2139 (defcustom wl-message-buffer-prefetch-folder-type-list '(imap4 nntp)
2140   "*All folder types that match this list prefetch next message,
2141 and reserved buffer cache."
2142   :type `(choice (const :tag "all" t)
2143                  (const :tag "never" nil)
2144                  (set (const localdir)
2145                       (const localnews)
2146                       (const maildir)
2147                       (const imap4)
2148                       (const nntp)
2149                       (const pop3)
2150                       (const shimbun)
2151                       (const nmz)
2152                       (const archive)
2153                       (const mark)
2154                       (const cache)))
2155   :group 'wl-pref)
2156
2157 (defcustom wl-message-buffer-prefetch-folder-list nil
2158   "*All folders that match this list prefetch next message,
2159 and reserved buffer cache.
2160 e.x.
2161 '(\"^[-%]\")"
2162   :type '(repeat (regexp :tag "Folder Regexp"))
2163   :group 'wl-pref)
2164
2165 (defcustom wl-message-buffer-prefetch-depth 1
2166   "*Depth of buffer prefetch in summary mode."
2167   :type 'integer
2168   :group 'wl-pref)
2169
2170 (defcustom wl-message-buffer-prefetch-idle-time 1
2171   "*Idle time of buffer prefetch."
2172   :type 'number
2173   :group 'wl-pref)
2174
2175 (defcustom wl-message-buffer-prefetch-threshold 30000
2176   "*Quit forward cache prefetching if message size is larger than this value."
2177   :type 'integer
2178   :group 'wl-pref)
2179
2180 (defcustom wl-summary-always-sticky-folder-list nil
2181   "All folders that match this list has sticky summary.
2182 Each elements are regexp of folder name."
2183   :type '(radio (const :tag "none" nil)
2184                 (const :tag "all" t)
2185                 (repeat (regexp :tag "Folder Regexp")))
2186   :group 'wl-pref)
2187
2188 (defcustom wl-no-save-folder-list '("^/.*$" "^\\[.*$")
2189   "All folders that match this list won't save its msgdb.
2190 Each elements are regexp of folder name."
2191   :type '(repeat (regexp :tag "Folder Regexp"))
2192   :group 'wl-pref)
2193
2194 (defcustom wl-save-folder-list nil
2195   "All folders that match this list save its msgdb.
2196 Each elements are regexp of folder name."
2197   :type '(repeat (regexp :tag "Folder Regexp"))
2198   :group 'wl-pref)
2199
2200 (defcustom wl-folder-mime-charset-alist
2201   '(("^-alt\\.chinese" . big5)
2202     ("^-relcom\\." . koi8-r)
2203     ("^-tw\\." . big5)
2204     ("^-han\\." . euc-kr)
2205     ("@sponichi" . shift_jis)
2206     ("@2ch" . shift_jis))
2207   "Charset alist.  If no match, `wl-mime-charset' is used."
2208   :type '(repeat (cons (regexp :tag "Folder Regexp") (symbol :tag "Charset")))
2209   :group 'wl-summary
2210   :group 'wl-pref)
2211
2212 (defcustom wl-folder-weekday-name-lang-alist
2213   '(("^-alt\\.chinese" . "en")
2214     ("^-relcom\\." . "en")
2215     ("^-tw\\." . "en")
2216     ("^-han\\." . "en"))
2217   "Weekday name lang alist.
2218 If no match, `wl-summary-weekday-name-lang' is used.
2219 e.x.
2220 '((\"xemacs-beta$\" . \"en\")
2221   (\"^-fj\" . \"ja\"))"
2222   :type '(repeat (cons (regexp :tag "Folder Regexp")
2223                        (choice (const "ja")
2224                                (const "en")
2225                                (const "fr")
2226                                (const "de")
2227                                (string :tag "Other"))))
2228   :group 'wl-pref)
2229
2230 (defcustom wl-folder-thread-indent-set-alist
2231   '(("^-alt\\.chinese" . (2 "+" "+" "|" "-" " "))
2232     ("^-relcom\\." . (2 "+" "+" "|" "-" " "))
2233     ("^-tw\\." . (2 "+" "+" "|" "-" " "))
2234     ("^-han\\." . (2 "+" "+" "|" "-" " ")))
2235   "Thread indent set alist.
2236 If no match, following indent set is used.
2237 \(wl-thread-indent-level
2238  wl-thread-have-younger-brother-str
2239  wl-thread-youngest-child-str
2240  wl-thread-vertical-str
2241  wl-thread-horizontal-str
2242  wl-thread-space-str)
2243 e.x.
2244 '((\"xemacs-beta$\" . (2 \"+\" \"+\" \"|\" \"-\" \" \")))"
2245   :type '(repeat (cons (regexp :tag "Folder Regexp")
2246                        (group (integer :tag "Indent")
2247                               (string :tag "Yonger Brother")
2248                               (string :tag "Yonger Child")
2249                               (string :tag "Vertical")
2250                               (string :tag "Horizontal")
2251                               (string :tag "Space"))))
2252   :group 'wl-pref)
2253
2254 (defcustom wl-folder-sync-range-alist
2255   (list (cons 'wl-require-update-all-folder-p "all")
2256         (cons "^'flag" "all"))
2257   "*Default sync range alist.  If no matches, `wl-default-sync-range' is used."
2258   :type '(repeat (cons (choice (regexp :tag "Folder Regexp")
2259                                (symbol :tag "A function"))
2260                        (choice (const "update")
2261                                (const "all")
2262                                (const "rescan")
2263                                (const "no-sync")
2264                                (const :tag "none" nil))))
2265   :group 'wl-pref)
2266
2267 (defcustom wl-default-sync-range  "update"
2268   "*Default sync range."
2269   :type '(choice (const "update")
2270                  (const "all")
2271                  (const "rescan")
2272                  (const "no-sync")
2273                  (const :tag "none" nil))
2274   :group 'wl-pref)
2275
2276 (defcustom wl-ask-range t
2277   "*If non-nil, ask for a range for summary synchronization.
2278 If nil, always use default."
2279   :type 'boolean
2280   :group 'wl-pref)
2281
2282 (defcustom wl-folder-process-duplicates-alist nil
2283   "Specify process type of duplicated messages.
2284 It should be a list of cons cell like: (REGEXP . TYPE)
2285 REGEXP is a regular expression string of folder name.
2286 TYPE is one of the symbols `hide' or `read'.
2287 `hide' means hide duplicated messages.
2288 `read' means mark as read duplicated messages.
2289 If TYPE is nil, do nothing for duplicated messages."
2290   :type '(repeat (cons (regexp :tag "Folder regexp")
2291                        (choice (const :tag "Hide" hide)
2292                                (const :tag "Mark as read" read))))
2293   :group 'wl-folder)
2294
2295 (defcustom wl-folder-move-cur-folder nil
2296   "*Non-nil, move cursor to current folder on folder buffer when goto folder."
2297   :type 'boolean
2298   :group 'wl-folder)
2299
2300 (defcustom wl-folder-check-async t
2301   "*Check the folder asynchronous."
2302   :type 'boolean
2303   :group 'wl-folder)
2304
2305 (defcustom wl-folder-notify-deleted nil
2306   "*Non-nil, display negative number on folder-mode when message is deleted
2307 in folder. If the value is 'sync, msgdb would be synchronized."
2308   :type '(choice (const :tag "off" nil)
2309                  (const :tag "on" t)
2310                  (const sync))
2311   :group 'wl-folder)
2312
2313 (defcustom wl-summary-exit-next-move t
2314   "*Non-nil, move to next-unsync or next-entity when exit summary."
2315   :type 'boolean
2316   :group 'wl-summary)
2317
2318 (defcustom wl-summary-next-no-unread-command
2319   '(wl-summary-read wl-summary-down wl-summary-up)
2320   "*Command list available when the value of `wl-auto-select-next' is 'unread
2321 or 'skip-no-unread."
2322   :type '(repeat function)
2323   :group 'wl-summary)
2324
2325 (defcustom wl-summary-search-via-nntp 'confirm
2326   "*Non-nil, search message via nntp after `wl-summary-jump-to-msg-by-message-id'.
2327 If the value is 'confirm, confirm before search, 'force to search via nntp
2328 regardless of current folder type."
2329   :type '(choice (const :tag "confirm" confirm)
2330                  (const :tag "always" force)
2331                  (const :tag "in nntp folder" t)
2332                  (const :tag "never" nil))
2333   :group 'wl-summary)
2334
2335 (defcustom wl-summary-keep-cursor-command
2336   '(wl-summary-goto-folder wl-summary-goto-last-visited-folder)
2337   "*Command list to keep cursor position when folder is changed to
2338 already existing summary."
2339   :type '(repeat function)
2340   :group 'wl-summary)
2341
2342 (defcustom wl-summary-showto-folder-regexp nil
2343   "Regexp specifying the folder that shows the To (or Newsgroups) field as
2344 Sender information in summary mode."
2345   :type '(choice (const :tag "none" nil)
2346                  regexp)
2347   :group 'wl-summary)
2348
2349 (defcustom wl-summary-save-file-suffix ".eml"
2350   "Suffix for the saved file name."
2351   :type 'string
2352   :group 'wl-summary)
2353
2354 (defcustom wl-folder-removed-mark "#<removed>"
2355   "Mark for removed folder."
2356   :type 'string
2357   :group 'wl-folder)
2358
2359 (defcustom wl-folder-unsubscribe-mark "#"
2360   "Mark for unsubscribe folder."
2361   :type 'string
2362   :group 'wl-folder)
2363
2364 (defcustom wl-dispose-folder-alist '(("^-" . remove)
2365                                      ("^@" . remove))
2366   "*Alist of folder and dispose policy.
2367 Each element is (folder-regexp . policy).
2368
2369 The policy is one of the followings:
2370 'remove or
2371 'null     : remove message.
2372 string    : refile to the specified folder.
2373 'trash or
2374 otherwise : refile to the `wl-trash-folder'.
2375 ex.
2376 '((\"^%\" . \"%#mh/trash\")
2377   (\"^-\" . remove)
2378   (\"^\\\\+\" . trash))"
2379   :type '(repeat (cons (regexp :tag "Folder Regexp")
2380                        (choice :tag "Policy"
2381                                (const remove)
2382                                (const :tag "remove(null)" null)
2383                                (const trash)
2384                                (const :tag "trash(other)" trash)
2385                                (string :tag "Folder"))))
2386   :group 'wl-folder)
2387
2388 (defcustom wl-folder-hierarchy-access-folders '("^-[^\\.]*\\(:\\|@\\|$\\)"
2389                                                 "^@$" "^'$")
2390   "*Access group REGEXPs to make hierarchy structure."
2391   :type '(repeat (string :tag "Regexp"))
2392   :group 'wl-folder)
2393
2394 (defcustom wl-folder-init-load-access-folders nil
2395   "*Access group folders to load folder list on `wl-folder-init'.
2396 If this variable is non-nil,
2397 `wl-folder-init-no-load-access-folders' will be ignored."
2398   :type '(repeat (regexp :tag "Folder Regexp"))
2399   :group 'wl-folder)
2400
2401 (defcustom wl-folder-init-no-load-access-folders nil
2402   "*Access group folders to not load folder list on `wl-folder-init'.
2403 If `wl-folder-init-load-access-folders' is non-nil,
2404 this variable will be ignored."
2405   :type '(repeat (regexp :tag "Folder Regexp"))
2406   :group 'wl-folder)
2407
2408 (defcustom wl-folder-access-subscribe-alist nil
2409   "*Subscribe folders to fetching folder entries.
2410 Each element is (group-regexp (subscribe folder-regexp ...)).
2411 If subscribe is non-nil, subscribe when match folder-regexp.
2412 If subscribe is nil, unsubscribe when match folder-regexp.
2413
2414 ex.
2415 '((\"^-fj$\"   . (t   \"^-fj\\\\.\\\\(editor\\\\|mail\\\\|net\\\\|news\\\\)\"))
2416   (\"^-comp$\" . (t   \"^-comp\\\\.unix\" \"^-comp\\\\.sys\"))
2417   (\"^-$\"     . (nil \"^-alt\" \"^-rec\")))"
2418   :type '(repeat (cons (regexp :tag "Folder Regexp")
2419                        (list (boolean :tag "Subscribed")
2420                              (repeat :inline t
2421                                      (regexp :tag "Folder Regexp")))))
2422   :group 'wl-folder)
2423
2424 ;;; For Folder Manager
2425
2426 (defcustom wl-interactive-save-folders t
2427   "*Non-nil require your confirmation when save folders."
2428   :type 'boolean
2429   :group 'wl-folder
2430   :group 'wl-setting)
2431
2432 (defcustom wl-fldmgr-make-backup t
2433   "*Non-nil make backup file when save folders."
2434   :type 'boolean
2435   :group 'wl-folder)
2436
2437 (defcustom wl-fldmgr-folders-indent "\t"
2438   "*Indent string for folders file."
2439   :type 'string
2440   :group 'wl-folder)
2441
2442 (defcustom wl-fldmgr-sort-function 'wl-fldmgr-sort-standard
2443   "*A function to sort folder."
2444   :type 'function
2445   :group 'wl-folder)
2446
2447 (defcustom wl-fldmgr-sort-group-first t
2448   "*Non-nil Group folder is first when sort."
2449   :type 'function
2450   :group 'wl-folder)
2451
2452 (defcustom wl-fldmgr-add-complete-with-current-folder-list nil
2453   "*If non-nil, completion for adding folder refers current folder list."
2454   :type 'boolean
2455   :group 'wl-folder)
2456
2457 (defcustom wl-fldmgr-make-filter-default "Body"
2458   "*Default filter key while making filter on Folder."
2459   :type '(radio (const "From")
2460                 (const "Subject")
2461                 (const "To")
2462                 (const "Cc")
2463                 (const "Body")
2464                 (const "Since")
2465                 (const "Before")
2466                 (const "Last")
2467                 (const "First")
2468                 (string :tag "Other"))
2469   :group 'wl-folder)
2470
2471 (defcustom wl-fldmgr-allow-rename-access-group nil
2472   "*If non-nil, allow to rename folder in access group."
2473   :type 'boolean
2474   :group 'wl-folder)
2475
2476 ;;; For Expire and Archive
2477
2478 (defcustom wl-expire-alist nil
2479   "Alist to decide a policy for expire.
2480 Each element is (folder-regexp (number or date) policy).
2481
2482 The policy is one of the followings:
2483 'remove  : remove messsage.
2484 'trash   : refile `wl-trash-folder'.
2485 string   : refile string folder.
2486 function : call function.
2487
2488 ex.
2489 '((\"^\\\\+ml/wl$\"             (number 500 510) wl-expire-archive-number1 t)
2490   (\"^\\\\+ml/\"                (number 300 305) wl-expire-archive-number2)
2491   (\"^\\\\+outbox$\"            (number 300) \"$outbox;lha\")
2492   (\"^\\\\(\\\\+tmp\\\\|\\\\+trash\\\\)$\"      (date 7) remove)
2493   (\"^\\\\+misc$\"              (date 14) trash))"
2494   :type '(repeat (choice (list :tag "No-match"
2495                                (regexp :tag "Folder Regexp")
2496                                (const nil))
2497                          (list :tag "Match"
2498                                (regexp :tag "Folder Regexp")
2499                                (list (radio :value number
2500                                             (const number)
2501                                             (const date))
2502                                      (list :inline t
2503                                            integer
2504                                            (repeat :inline t integer)))
2505                                (choice :tag "Policy"
2506                                        :value remove
2507                                        (const remove)
2508                                        (const trash)
2509                                        (string :tag "folder")
2510                                        function)
2511                                (repeat :inline t
2512                                        :tag "Arg for function"
2513                                        sexp))))
2514   :group 'wl-expire)
2515
2516 (defcustom wl-archive-alist '((".*" wl-archive-number1))
2517   "Alist to decide a policy for archive.
2518 Each element is (folder-regexp policy(function)).
2519
2520 ex.
2521 '((\"\\\\+work$\" wl-archive-date)
2522   (\"\\\\+ml/\"   wl-archive-number1)
2523   (\".*\"       wl-archive-number2))"
2524   :type '(repeat (list (regexp :tag "Folder Regexp")
2525                        function
2526                        (repeat :inline t
2527                                (sexp :tag "Argument"))))
2528   :group 'wl-expire)
2529
2530 (defcustom wl-summary-expire-reserve-marks
2531   (list wl-summary-flag-mark
2532         wl-summary-new-uncached-mark
2533         wl-summary-new-cached-mark
2534         wl-summary-unread-uncached-mark
2535         wl-summary-unread-cached-mark)
2536   "Permanent marks of reserved message when expire.
2537 Don't reserve temporary mark message.
2538
2539 ex.
2540 'all  : reserved all permanent marks.
2541 'none : not reserve permanent marks.
2542 list  : reserved specified permanent marks."
2543   :type '(repeat (string :tag "Mark"))
2544   :group 'wl-expire)
2545
2546 (defcustom wl-expire-number-with-reserve-marks nil
2547   "If non-nil, include reserve message when expire by number."
2548   :type 'boolean
2549   :group 'wl-expire)
2550
2551 (defcustom wl-expire-add-seen-list t
2552   "*If non-nil, add seen message list when refile message at expire."
2553   :type 'boolean
2554   :group 'wl-expire)
2555
2556 (defcustom wl-expire-use-log nil
2557   "*If non-nil, write a log when expired."
2558   :type 'boolean
2559   :group 'wl-expire)
2560
2561 (defcustom wl-expire-folder-update-msgdb t
2562   "*Non-nil update summary msgdb when expire on folder mode."
2563   :type 'boolean
2564   :group 'wl-expire)
2565
2566 ;; for wl-expire-archive-{number1|number2}
2567 (defcustom wl-expire-archive-files 100
2568   "*The number of one archive folder."
2569   :type 'integer
2570   :group 'wl-expire)
2571
2572 ;; for wl-expire-archive-{number1|number2|date}
2573 (defcustom wl-expire-archive-get-folder-function
2574   'wl-expire-archive-get-folder
2575   "*A function to get archive folder name."
2576   :type 'function
2577   :group 'wl-expire)
2578
2579 (defcustom wl-expire-delete-oldmsg-confirm t
2580   "*If non-nil, require your confirmation when delete old message."
2581   :type 'boolean
2582   :group 'wl-expire)
2583
2584 ;; for wl-expire-archive-get-folder
2585 (defcustom wl-expire-archive-folder-type 'zip
2586   "*Archiver type of archive folder."
2587   :type '(radio (const zip)
2588                 (const lha)
2589                 (const zoo)
2590                 (const rar)
2591                 (const tar)
2592                 (const tgz)
2593                 (symbol :tag "Other"))
2594   :group 'wl-expire)
2595
2596 (defcustom wl-expire-archive-folder-name-fmt "%s-%%05d;%s" ;; $folder-00100;zip
2597   "*A format string for archive folder name."
2598   :type 'string
2599   :group 'wl-expire)
2600
2601 (defcustom wl-expire-archive-folder-num-regexp "-\\([0-9]+\\);"
2602   "*A regexp string for archive folder name."
2603   :type 'string
2604   :group 'wl-expire)
2605
2606 (defcustom wl-expire-archive-date-folder-name-fmt "%s-%%04d%%02d;%s"
2607                                                 ;; $folder-199812;zip
2608   "*A format string for archive date folder name."
2609   :type 'string
2610   :group 'wl-expire)
2611
2612 (defcustom wl-expire-archive-date-folder-num-regexp "-\\([0-9]+\\);"
2613   "*A regexp string for archive date folder name."
2614   :type 'string
2615   :group 'wl-expire)
2616
2617 (defcustom wl-expire-archive-folder-prefix nil
2618   "*Prefix for archive folder."
2619   :type '(radio (const :tag "nothing" nil)
2620                 (const :tag "full" t)
2621                 (const short))
2622   :group 'wl-expire)
2623
2624 ;;;; Highlights.
2625
2626 ;; highilght about summary
2627 (defcustom wl-highlight-max-summary-lines 10000
2628   "*If the summary is larger than this lines, don't highlight it."
2629   :type 'integer
2630   :group 'wl-highlight)
2631
2632 ;; highilght about draft and message
2633 (defcustom wl-highlight-body-too t
2634   "*In addition to header, highlight the body too.  if non nil."
2635   :type 'boolean
2636   :group 'wl-highlight)
2637
2638 (defcustom wl-highlight-message-header-alist
2639   '(("Subject[ \t]*:" . wl-highlight-message-important-header-contents)
2640     ("From[ \t]*:\\|To[ \t]*:" . wl-highlight-message-important-header-contents2)
2641     ("X-[^ \t]*:\\|User-Agent[ \t]*:" . wl-highlight-message-unimportant-header-contents))
2642   ""
2643   :type '(repeat (cons regexp face))
2644   :group 'wl-highlight)
2645
2646 (defcustom wl-highlight-citation-prefix-regexp
2647   "^[>|:} ]*[>|:}]\\([^ \n>]*>\\)?\\|^[^ <\n>]*>"
2648   "All lines that match this regexp will be highlighted with
2649  `wl-highlight-message-cited-text-*' face."
2650   :type 'regexp
2651   :group 'wl-highlight)
2652
2653 (defcustom wl-highlight-highlight-citation-too nil
2654   "*Whether the whole citation line should go in the
2655 `wl-highlight-citation-face' face.
2656 If nil, the text matched by `wl-highlight-citation-prefix-regexp' is in the
2657 default face, and the remainder of the line is in the
2658 wl-highlight-message-cited-text face."
2659   :type 'boolean
2660   :group 'wl-highlight)
2661
2662 (defcustom wl-highlight-force-citation-header-regexp
2663   "^>>>.*$\\|^[ \t]*<[^>]*>[ \t]*$"
2664   "*The pattern to match the prolog of a cited block.
2665 Text in the body of a message which matches this will be displayed in
2666 the `wl-highlight-message-headers' face."
2667   :type 'regexp
2668   :group 'wl-highlight)
2669
2670 (defcustom wl-highlight-citation-header-regexp
2671   (concat "In article.*$\\|In message.*$\\|In the message.*$\\|"
2672           "^At[^\n]+\n[^\n]+wrote:\n\\|"
2673           "^.*\\(writes\\|wrote\\|said\\):\n")
2674   "*The pattern to match the prolog of a cited block.
2675 Text in the body of a message which matches this will be displayed in
2676 the `wl-highlight-message-headers' face."
2677   :type 'regexp
2678   :group 'wl-highlight)
2679
2680 (defcustom wl-highlight-max-header-size nil
2681   "*If the message header is larger than this many chars, don't highlight it.
2682 If this is nil, all headers will be highlighted."
2683   :type 'integer
2684   :group 'wl-highlight)
2685
2686 (defcustom wl-highlight-max-message-size 10000
2687   "*If the message body is larger than this many chars, don't highlight it.
2688 This is to prevent us from wasting time trying to fontify things like
2689 uuencoded files and large digests.  If this is nil, all messages will
2690 be highlighted."
2691   :type 'integer
2692   :group 'wl-highlight)
2693
2694 ;; highilght about signature (of draft and message)
2695 (defcustom wl-highlight-signature-separator
2696   '("\n--+\n" "\n\n--+.*\n*\\'")
2697   "List of regexps matching signature separator.
2698 It will be verified from head to tail looking for a separator.
2699 Verification will be done from the end of the buffer.
2700 No need to specify \"^-- $\" in this list,
2701 because it is verified by default.
2702 This variable can also be a regex."
2703   :type '(repeat regexp)
2704   :group 'wl-highlight)
2705
2706 (defcustom wl-max-signature-size 400
2707   "*If the signature is larger than this chars, don't treat it as a signature."
2708   :type 'integer
2709   :group 'wl-highlight)
2710
2711 ;; highilght about mouse
2712 (defcustom wl-use-highlight-mouse-line (and window-system
2713                                             (>= emacs-major-version 19))
2714   "*Highlight mouse line, if non-nil."
2715   :type 'boolean
2716   :group 'wl-highlight)
2717
2718 (defcustom wl-use-flag-folder-help-echo nil
2719   "*Display help-echo in the flag folder if non-nil."
2720   :type 'boolean
2721   :group 'wl-highlight)
2722
2723 ;; highilght about folder
2724 (defcustom wl-highlight-folder-with-icon
2725   (or (and (featurep 'xemacs)
2726            (featurep 'xpm))
2727       wl-on-emacs21)
2728   "*Highlight folder with icon(XEmacs or Emacs 21)."
2729   :type 'boolean
2730   :group 'wl-highlight)
2731 (defcustom wl-highlight-folder-by-numbers t
2732   "Highlight folder lines by numbers.
2733 If it is a number, only numbers will be highlighted."
2734   :type '(choice (const :tag "whole line" t)
2735                  (const :tag "only numbers" 1)
2736                  (const :tag "don't highlight" nil))
2737   :group 'wl-highlight)
2738
2739 (defcustom wl-highlight-signature-search-function 'wl-highlight-signature-search
2740   "Function to search signature area in the message body."
2741   :type 'function
2742   :group 'wl-highlight)
2743
2744 (defcustom wl-use-dnd (and wl-on-xemacs
2745                            (featurep 'dragdrop))
2746   "If Non-nil, support dragdrop feature in XEmacs."
2747   :type 'boolean
2748   :group 'wl-pref)
2749
2750 (defcustom wl-reset-plugged-alist t
2751   "*If non-nil, reset `elmo-plugged-alist' when startup."
2752   :type 'boolean
2753   :group 'wl-pref)
2754
2755 (defcustom wl-demo-display-logo (if (or (featurep 'xemacs)
2756                                         (module-installed-p 'image)
2757                                         (module-installed-p 'bitmap))
2758                                     t)
2759   "If it is T, show graphic logo in the startup screen.  You can set it to
2760 a symbol `bitmap', `xbm' or `xpm' in order to force the image format."
2761   :type '(radio (const :tag "Off" nil)
2762                 (const :tag "On (any format)" t)
2763                 (const xpm)
2764                 (const xbm)
2765                 (const :tag "bitmap (using BITMAP-MULE)" bitmap))
2766   :group 'wl-pref)
2767
2768 (defcustom wl-invalid-character-message "(WL:Invalid characters.)"
2769   "*A string displayed when invalid character exists."
2770   :type 'string
2771   :group 'wl-pref)
2772
2773 ;;; Internal variables
2774 (defvar wl-init nil)
2775
2776 ;; For disconnected operations.
2777 (defvar wl-plugged-hook nil)
2778 (defvar wl-unplugged-hook nil)
2779 (defcustom wl-plugged t
2780   "*Plugged state at the startup.  Nil means off-line."
2781   :type 'boolean
2782   :group 'wl
2783   :group 'wl-setting)
2784
2785 ;; Internal variables used to modeline identifiers.
2786 (defvar wl-modeline-plug-status nil)
2787 (defvar wl-modeline-plug-state-on wl-plug-state-indicator-on)
2788 (defvar wl-modeline-plug-state-off wl-plug-state-indicator-off)
2789 (defvar wl-modeline-biff-status nil)
2790 (defvar wl-modeline-biff-state-on wl-biff-state-indicator-on)
2791 (defvar wl-modeline-biff-state-off wl-biff-state-indicator-off)
2792
2793 ;; Advanced thread view.
2794 (defvar wl-thread-indent-level (if wl-on-mule 1 2)
2795   "*Indent level for thread.")
2796 (defvar wl-thread-have-younger-brother-str (if wl-on-mule "\e$B(2\e(B" "+")
2797   "*A string for thread branch line.  It should contain one character.")
2798 (defvar wl-thread-youngest-child-str       (if wl-on-mule "\e$B(1\e(B" "+")
2799   "*A string for thread branch line.  It should contain one character.")
2800 (defvar wl-thread-vertical-str             (if wl-on-mule "\e$B(-\e(B" "|")
2801   "*A string for thread branch line.  It should contain one character.")
2802 (defvar wl-thread-horizontal-str           (if wl-on-mule "\e$B(,\e(B" "-")
2803   "*A string for thread branch line.  It should contain one character.")
2804 (defvar wl-thread-space-str                (if wl-on-mule "\e$B!!\e(B" " ")
2805   "*A string for thread branch line.  It should contain one character.")
2806
2807 ;; folder icons. filename relative to wl-icon-directory
2808 (defvar wl-opened-group-folder-icon "opened.xpm"
2809   "*Icon file for opened group folder.")
2810 (defvar wl-closed-group-folder-icon "closed.xpm"
2811   "*Icon file for closed group folder.")
2812 (defvar wl-nntp-folder-icon "news.xpm"
2813   "*Icon file for nntp folder.")
2814 (defvar wl-imap-folder-icon "imap.xpm"
2815   "*Icon file for imap folder.")
2816 (defvar wl-pop-folder-icon  "pop.xpm"
2817   "*Icon file for pop folder.")
2818 (defvar wl-localdir-folder-icon "local.xpm"
2819   "*Icon file for localdir folder.")
2820 (defvar wl-localnews-folder-icon "localnews.xpm"
2821   "*Icon file for localnews folder.")
2822 (defvar wl-internal-folder-icon "internal.xpm"
2823   "*Icon file for internal folder.")
2824 (defvar wl-multi-folder-icon "multi.xpm"
2825   "*Icon file for multi folder.")
2826 (defvar wl-filter-folder-icon "filter.xpm"
2827   "*Icon file for filter folder.")
2828 (defvar wl-archive-folder-icon "archive.xpm"
2829   "*Icon file for archive folder.")
2830 (defvar wl-pipe-folder-icon "pipe.xpm"
2831   "*Icon file for pipe folder.")
2832 (defvar wl-nmz-folder-icon "nmz.xpm"
2833   "*Icon file for namazu folder.")
2834 (defvar wl-shimbun-folder-icon "shimbun.xpm"
2835   "*Icon file for shimbun folder.")
2836 (defvar wl-file-folder-icon "file.xpm"
2837   "*Icon file for file folder.")
2838 (defvar wl-maildir-folder-icon "maildir.xpm"
2839   "*Icon file for maildir folder.")
2840 (defvar wl-empty-trash-folder-icon "trash-e.xpm"
2841   "*Icon file for emptied trash folder.")
2842 (defvar wl-trash-folder-icon "trash.xpm"
2843   "*Icon file for trash folder.")
2844 (defvar wl-draft-folder-icon "draft.xpm"
2845   "*Icon file for draft folder.")
2846 (defvar wl-queue-folder-icon "queue.xpm"
2847   "*Icon file for queue folder.")
2848 (defvar wl-plugged-icon "plugged.xpm"
2849   "*Icon file for plugged state.")
2850 (defvar wl-unplugged-icon "unplugged.xpm"
2851   "*Icon file for unplugged state.")
2852 (defvar wl-biff-mail-icon "letter.xpm"
2853   "*Icon file for mail existed state.")
2854 (defvar wl-biff-nomail-icon "no-letter.xpm"
2855   "*Icon file for no mail existed state.")
2856 (defvar wl-prog-uudecode "uudecode"
2857   "*uudecode program name.")
2858 (defvar wl-prog-uudecode-arg nil
2859   "*Arguments for uudecode program.")
2860 (defvar wl-prog-uudecode-no-stdout-option t
2861   "*If non-nil, uudecode program don't have option for output to stdout.")
2862
2863 ;; plug
2864 (defvar wl-plugged-plug-on "ON")
2865 (defvar wl-plugged-plug-off "--")
2866 (defvar wl-plugged-auto-off "**")
2867 (defvar wl-plugged-server-indent 2)
2868 (defvar wl-plugged-port-indent 4)
2869 (defvar wl-plugged-queue-status-column 25)
2870
2871 ;;;; Obsolete variables.
2872
2873 ;; 2003-11-05
2874 (elmo-define-obsolete-variable 'wl-summary-new-mark
2875                                'wl-summary-new-uncached-mark)
2876
2877 ;; 2003-07-15 delete -> dispose
2878 (elmo-define-obsolete-variable 'wl-delete-folder-alist
2879                                'wl-dispose-folder-alist)
2880
2881 ;; 2002-12-25
2882 (elmo-define-obsolete-variable 'wl-draft-reply-myself-with-argument-list
2883                                'wl-draft-reply-with-argument-list)
2884 (elmo-define-obsolete-variable 'wl-draft-reply-myself-without-argument-list
2885                                'wl-draft-reply-without-argument-list)
2886
2887 ;; 2001-12-11: *-dir -> *-directory
2888 (elmo-define-obsolete-variable 'wl-icon-dir
2889                                'wl-icon-directory)
2890 (elmo-define-obsolete-variable 'wl-mime-save-dir
2891                                'wl-mime-save-directory)
2892 (elmo-define-obsolete-variable 'wl-score-files-dir
2893                                'wl-score-files-directory)
2894 (elmo-define-obsolete-variable 'wl-tmp-dir
2895                                'wl-temporary-file-directory)
2896
2897 ;; 2001-12-10
2898 (elmo-define-obsolete-variable 'wl-summary-update-confirm-threshold
2899                                'elmo-folder-update-threshold)
2900 (elmo-define-obsolete-variable 'wl-fetch-confirm-threshold
2901                                'elmo-message-fetch-threshold)
2902
2903 (elmo-define-obsolete-variable 'wl-cache-prefetch-folder-type-list
2904                                'wl-message-buffer-prefetch-folder-type-list)
2905 (elmo-define-obsolete-variable 'wl-cache-prefetch-folder-list
2906                                'wl-message-buffer-prefetch-folder-list)
2907
2908 ;; 2001-02-27: *-func -> *-function
2909 (elmo-define-obsolete-variable 'wl-summary-from-func
2910                                'wl-summary-from-function)
2911 (elmo-define-obsolete-variable 'wl-summary-subject-func
2912                                'wl-summary-subject-function)
2913 (elmo-define-obsolete-variable 'wl-summary-subject-filter-func
2914                                'wl-summary-subject-filter-function)
2915 (elmo-define-obsolete-variable 'wl-draft-send-func
2916                                'wl-draft-send-function)
2917 (elmo-define-obsolete-variable 'wl-draft-send-news-func
2918                                'wl-draft-send-news-function)
2919 (elmo-define-obsolete-variable 'wl-draft-send-mail-func
2920                                'wl-draft-send-mail-function)
2921 (elmo-define-obsolete-variable 'wl-print-buffer-func
2922                                'wl-print-buffer-function)
2923 (elmo-define-obsolete-variable 'wl-ps-print-buffer-func
2924                                'wl-ps-print-buffer-function)
2925 (elmo-define-obsolete-variable 'wl-generate-mailer-string-func
2926                                'wl-generate-mailer-string-function)
2927 (elmo-define-obsolete-variable 'wl-highlight-x-face-func
2928                                'wl-highlight-x-face-function)
2929 (elmo-define-obsolete-variable 'wl-fldmgr-sort-func
2930                                'wl-fldmgr-sort-function)
2931 (elmo-define-obsolete-variable 'wl-expire-archive-get-folder-func
2932                                'wl-expire-archive-get-folder-function)
2933 (elmo-define-obsolete-variable 'wl-highlight-signature-search-func
2934                                'wl-highlight-signature-search-function)
2935
2936 ;; 2000-01-25: temp mark -> target mark
2937 (elmo-define-obsolete-variable 'wl-summary-temp-above
2938                                'wl-summary-target-above)
2939
2940 ;; 1999-11-07: Unified with `wl-draft-config-alist'.
2941 (defvar wl-draft-prepared-config-alist nil)
2942 (make-obsolete-variable 'wl-draft-prepared-config-alist
2943                         'wl-draft-config-alist)
2944
2945 ;; 1999-10-10
2946 (elmo-define-obsolete-variable 'wl-address-filename
2947                                'wl-address-file)
2948 (elmo-define-obsolete-variable 'wl-score-default-file-name
2949                                'wl-score-default-file)
2950
2951
2952 (require 'product)
2953 (product-provide (provide 'wl-vars) (require 'wl-version))
2954
2955 ;;; wl-vars.el ends here