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