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