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