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