Initial Commit
[packages] / xemacs-packages / mew / mew / mew-vars.el
1 ;;; mew-vars.el --- Variables and Constants for Mew
2
3 ;; Author:  Kazu Yamamoto <Kazu@Mew.org>
4 ;; Created: Nov 22, 1997
5 ;; Revised: Aug 31, 1999
6
7 ;;; Code:
8
9 (defconst mew-vars-version "mew-vars.el version 0.05")
10
11 (require 'mew-env)
12
13 ;;;
14 ;;; Global Constants
15 ;;;
16
17 ;; Must be capitalized!
18
19 (defconst mew-subj: "Subject:")
20 (defconst mew-to:   "To:")
21 (defconst mew-cc:   "Cc:")
22 (defconst mew-from: "From:")
23 (defconst mew-date: "Date:")
24
25 (defconst mew-resent-to:   "Resent-To:")
26 (defconst mew-resent-cc:   "Resent-Cc:")
27 (defconst mew-resent-from: "Resent-From:")
28 (defconst mew-resent-date: "Resent-Date:")
29
30 (defconst mew-reply-to:    "Reply-To:")
31 (defconst mew-newsgroups:  "Newsgroups:")
32 (defconst mew-followup-to: "Followup-To:")
33
34 (defconst mew-bcc:  "Bcc:")
35 (defconst mew-dcc:  "Dcc:")
36 (defconst mew-fcc:  "Fcc:")
37
38 (defconst mew-resent-bcc:   "Resent-Bcc:")
39 (defconst mew-resent-dcc:   "Resent-Dcc:")
40
41 (defconst mew-message-id: "Message-Id:")
42 (defconst mew-references:  "References:")
43 (defconst mew-in-reply-to: "In-Reply-To:")
44
45 (defconst mew-apparently-to: "Apparently-To:")
46 (defconst mew-destination:-list
47   (list mew-to: mew-cc: mew-bcc: mew-apparently-to:))
48
49 (defconst mew-received: "Received:")
50
51 (defconst mew-x-mailer: "X-Mailer:")
52 (defconst mew-x-face:   "X-Face:")
53 (defconst mew-x-mew:    "X-Mew:")
54
55 (defconst mew-keywords: "Keywords:")
56 (defconst mew-config:   "Config:")
57 (defconst mew-body:     "Body:")
58
59 (defconst mew-mv:     "Mime-Version:")
60 (defconst mew-mv:-num "1.0")
61
62 (defconst mew-ct:  "Content-Type:")
63 (defconst mew-cte: "Content-Transfer-Encoding:")
64 (defconst mew-cd:  "Content-Description:")
65 (defconst mew-cid: "Content-ID:")
66 (defconst mew-cdp: "Content-Disposition:")
67
68 (defconst mew-ct-txt "Text/Plain")
69 (defconst mew-ct-msg "Message/Rfc822")
70 (defconst mew-ct-ext "Message/External-Body")
71 (defconst mew-ct-sts "Message/Delivery-Status")
72 (defconst mew-ct-mlm "Multipart/Mixed")
73 (defconst mew-ct-mls "Multipart/Signed")
74 (defconst mew-ct-mle "Multipart/Encrypted")
75 (defconst mew-ct-mld "Multipart/Digest")
76 (defconst mew-ct-ado "Audio/Basic")
77 (defconst mew-ct-apo "Application/Octet-Stream")
78 (defconst mew-ct-pgs "application/pgp-signature") ;; due to the RFC 1847 bug
79 (defconst mew-ct-pge "application/pgp-encrypted") ;; due to the RFC 1847 bug
80 (defconst mew-ct-apk "Application/Pgp-Keys")
81
82 (defconst mew-us-ascii "us-ascii")
83
84 (defconst mew-type-txt (list mew-ct-txt (list "charset" mew-us-ascii)))
85 (defconst mew-type-msg (list mew-ct-msg))
86 (defconst mew-type-mlm (list mew-ct-mlm))
87 (defconst mew-type-ado (list mew-ct-ado))
88 (defconst mew-type-apo (list mew-ct-apo))
89 (defconst mew-type-apk (list mew-ct-apk))
90
91 (defconst mew-b64  "base64")
92 (defconst mew-qp   "quoted-printable")
93 (defconst mew-xg   "x-gzip64")
94 (defconst mew-7bit "7bit")
95 (defconst mew-8bit "8bit")
96 (defconst mew-bin  "binary")
97
98 (defconst mew-decode-value 
99   (list mew-b64 mew-qp mew-xg mew-7bit mew-8bit mew-bin))
100 (defconst mew-decode-composite-value
101   (list mew-7bit mew-8bit mew-bin))
102
103 ;; must be list of list.
104 (defconst mew-mime-fields
105   (list (list mew-ct:  0 'analyze)
106         (list mew-cte: 1 'extract)
107         (list mew-cd:  2 'decode)
108         (list mew-cid: 3 nil)
109         (list mew-cdp: 4 'analyze)))
110
111 ;; strictly, content-* are necessary but they are not practical.
112 (defvar mew-field-database
113   (list (list mew-to:            'mailbox    'struct)
114         (list mew-cc:            'mailbox    'struct)
115         (list mew-from:          'mailbox    'struct)
116         (list mew-apparently-to: 'mailbox    'struct)
117         (list mew-bcc:           'mailbox    'struct)
118         (list mew-dcc:           'mailbox    'struct)
119         (list mew-reply-to:      'mailbox    'struct)
120         (list mew-resent-to:     'mailbox    'struct)
121         (list mew-resent-cc:     'mailbox    'struct)
122         (list mew-resent-bcc:    'mailbox    'struct)
123         (list mew-resent-dcc:    'mailbox    'struct)
124         (list mew-resent-from:   'mailbox    'struct)
125         (list mew-mv:            'mime       'struct)
126         (list mew-subj:          'text       'text)
127         (list mew-keywords:      'comma-text 'text)
128         (list mew-received:      'unstruct   'unstruct)
129         (list mew-references:    'unstruct   'unstruct)
130         (list mew-x-face:        'unstruct   'unstruct))
131   "(field enc dec)")
132
133 (defmacro mew-field-type-for-encoding (key)
134   (` (or (nth 1 (assoc (capitalize (, key)) mew-field-database)) 'unstruct)))
135
136 (defmacro mew-field-type-for-decoding (key)
137   (` (or (nth 2 (assoc (capitalize (, key)) mew-field-database)) 'text)))
138
139 (defconst mew-syntax-magic
140   (+ (length [key beg end pri]) (length mew-mime-fields)))
141
142 (defconst mew-x-mailer
143   (concat mew-version " on "
144           (if (string-match "XEmacs" emacs-version) "XEmacs" "Emacs")
145           (format " %d.%d " emacs-major-version emacs-minor-version)
146           (and (boundp 'xemacs-codename) (concat "(" xemacs-codename ")"))
147           (and (boundp 'mule-version) (concat "/ Mule " mule-version)))
148   "*A value inserted into X-Mailer: field in Draft mode if *non-nil*.")
149
150 (defconst mew-buffer-message     "*Mew message*")
151 (defconst mew-buffer-mime       " *mew mime*")
152 (defconst mew-buffer-cache      " *mew cache*")
153 (defconst mew-buffer-watch       "*Mew watch*")
154 (defconst mew-buffer-tmp        " *mew tmp*")
155 (defconst mew-buffer-burst      " *mew burst*")
156 (defconst mew-buffer-completions "*Mew completions*")
157 (defconst mew-buffer-ext        " *mew ext*")
158 (defconst mew-buffer-hello      " *mew hello*")
159 (defconst mew-buffer-pgpkey      "*Mew PGP Key*")
160 (defconst mew-buffer-addrbook    "*Mew Addrbook*")
161
162 (defconst mew-buffer-list
163   (list mew-buffer-mime mew-buffer-watch mew-buffer-tmp mew-buffer-burst
164         mew-buffer-completions mew-buffer-ext mew-buffer-hello
165         mew-buffer-pgpkey mew-buffer-addrbook))
166
167 (defconst mew-home (file-name-as-directory "~"))
168
169 (defconst mew-ext-suffix       ".ext")
170 (defconst mew-text-suffix      ".txt")
171 (defconst mew-audio-suffix     ".au")
172 (defconst mew-pgp-key-suffix   ".pka")
173 (defconst mew-pgp-ascii-suffix ".asc")
174
175 ;;;
176 ;;; Buffer local variables
177 ;;;
178
179 (defvar mew-summary-buffer-start-point nil)
180 (defvar mew-summary-buffer-process nil)
181 (defvar mew-summary-buffer-string nil)
182 (defvar mew-summary-buffer-config nil)
183 (defvar mew-summary-buffer-begin nil)
184 (defvar mew-summary-buffer-error nil)
185 (defvar mew-summary-buffer-wrong-pws nil)
186 (defvar mew-summary-buffer-reviews nil)
187 (defvar mew-summary-buffer-direction nil)
188 (defvar mew-summary-buffer-folder-cache-time nil)
189 (defvar mew-summary-buffer-refile nil)
190 (defvar mew-summary-buffer-disp-msg t)
191 (defvar mew-summary-buffer-left-msgs "-")
192 (defvar mew-watch-buffer-process nil)
193 (defvar mew-cache-attribute nil)
194 (defvar mew-cache-folder nil)
195 (defvar mew-cache-message-number nil)
196 (defvar mew-syntax-icon-spec nil)
197 (defvar mew-syntax-multi-form nil)
198 (defvar mew-syntax-privacy-result nil)
199 (defvar mew-decode-syntax nil)
200 (defvar mew-decode-error nil)
201 (defvar mew-decode-not-decrypted nil)
202 (defvar mew-encode-syntax nil)
203 (defvar mew-overlay-cursor-line nil)
204 (defvar mew-complete-window-config nil)
205
206 (mapcar (function make-variable-buffer-local)
207         (list 'mew-summary-buffer-start-point
208               'mew-summary-buffer-process
209               'mew-summary-buffer-string
210               'mew-summary-buffer-config
211               'mew-summary-buffer-begin
212               'mew-summary-buffer-error
213               'mew-summary-buffer-wrong-pws
214               'mew-summary-buffer-reviews
215               'mew-summary-buffer-direction
216               'mew-summary-buffer-folder-cache-time
217               'mew-summary-buffer-refile
218               'mew-summary-buffer-disp-msg
219               'mew-summary-buffer-left-msgs
220               'mew-watch-buffer-process
221               'mew-cache-attribute
222               'mew-cache-folder
223               'mew-cache-message-number
224               'mew-syntax-icon-spec
225               'mew-syntax-multi-form
226               'mew-syntax-privacy-result
227               'mew-encode-syntax
228               'mew-decode-syntax
229               'mew-decode-error
230               'mew-decode-not-decrypted
231               'mew-overlay-cursor-line
232               'mew-complete-window-config))
233
234 ;;;
235 ;;; Global Variables
236 ;;;
237
238 ;;
239 ;; Hooks
240 ;;
241
242 (defvar mew-env-hook nil
243   "*Hook called at initialize time before setting environment.")
244 (defvar mew-init-hook nil
245   "*Hook called at initialize time.")
246 (defvar mew-summary-mode-hook nil
247   "*Hook called in Summary mode.")
248 (defvar mew-virtual-mode-hook nil
249   "*Hook called in Virtual mode.")
250 (defvar mew-draft-mode-hook nil
251   "*Hook called in Draft mode.")
252 (defvar mew-draft-mode-newdraft-hook nil
253   "*Hook called in Draft mode only when new draft is prepared.")
254 (defvar mew-draft-mode-reedit-hook nil
255   "*Hook called in Draft mode only when an existing draft is used as draft.")
256 (defvar mew-message-mode-hook nil
257   "*Hook called in Message mode.")
258 (defvar mew-message-hook nil
259   "*Hook called whenever message displayed.")
260 (defvar mew-make-message-hook nil
261   "*Hook called before making a message in Draft mode. A good example
262 is as follows:
263   (add-hook 'mew-make-message-hook 'ispell-message)")
264 (defvar mew-send-hook nil
265   "*Hook called before sending a message in Draft mode.
266 This hook is meaningless now and is remained for backward-compatibility.")
267 (defvar mew-real-send-hook nil
268   "*Hook called before really sending a message in Draft mode")
269 (defvar mew-suspend-hook nil
270   "*Hook called on suspend.")
271 (defvar mew-quit-hook nil
272   "*Hook called on quit.")
273 (defvar mew-summary-inc-sentinel-hook nil
274   "*Hook called when inc finished.")
275 (defvar mew-summary-scan-sentinel-hook nil
276   "*Hook called when scan finished.")
277 (defvar mew-summary-exec-hook nil
278   "*Hook called when mew-summary-exec finished.")
279 (defvar mew-syntax-format-hook nil
280   "*Hook called when mew-syntax-format is called.")
281 (defvar mew-addrbook-mode-hook nil
282   "*Hook called in Addrbook mode.")
283
284 ;;
285 ;;
286 ;; Sub-programs
287 ;;
288
289 (defvar mew-prog-imget       "imget")
290 (defvar mew-prog-imls        "imls")
291 (defvar mew-prog-imcat       "imcat")
292 (defvar mew-prog-imclean     "imclean")
293 (defvar mew-prog-impath      "impath")
294 (defvar mew-prog-impack      "impack")
295 (defvar mew-prog-immv        "immv")
296 (defvar mew-prog-imrm        "imrm")
297 (defvar mew-prog-imput       "imput")
298 (defvar mew-prog-imsort      "imsort")
299 (defvar mew-prog-imstore     "imstore")
300 (defvar mew-prog-imgrep      "imgrep")
301 (defvar mew-prog-imjoin      "imjoin")
302 (defvar mew-prog-mime-encode "mewencode")
303 (defvar mew-prog-mime-decode "mewdecode")
304 (defvar mew-prog-unshar      "unshar")
305 (defvar mew-prog-uumerge     "uumerge")
306 (defvar mew-prog-tar         "tar")
307 (defvar mew-prog-compress    "compress")
308 (defvar mew-prog-gzip        "gzip")
309 (defvar mew-prog-utime       "touch")
310 (defvar mew-prog-pgp         "pgp"
311   "*PGP name for version check.")
312
313 (defvar mew-prog-uncompface  "uncompface")
314 (defvar mew-prog-shell       "/bin/sh")
315 ;;(defvar mew-prog-shell       "cmd.exe")
316
317 (defvar mew-prog-text/html     "netscape")
318 (defvar mew-prog-text/html-arg nil)
319
320 (defvar mew-prog-shell-arg   "-c")
321
322 (defvar mew-prog-im-arg '("--help=no" "--debug=no"))
323
324 (defvar mew-prog-imget-arg-list nil
325   "*Argument list for mew-prog-imget")
326 (defvar mew-prog-imls-arg-list nil
327   "*Argument list for mew-prog-imls")
328
329 ;;
330 ;; MIME types
331 ;;
332
333 (defmacro mew-ct-linebasep (ct)
334   (` (mew-member-case-equal (, ct) mew-mime-content-type-text-list)))
335
336 (defvar mew-mime-content-type-text-list
337   '("Text/Plain" "Text/Html"
338     "Application/Postscript"
339     "Message/Rfc822")
340   "Content-Type: list for text which are treated as text when encoded.")
341
342 (defvar mew-mime-content-type-multipart-list
343   '("Multipart/Mixed" "Multipart/Alternative"
344     ;;"Multipart/Digest" "Multipart/Parallel"
345     )
346   "Candidate of 'Content-Type: Multipart' when CT: is changed in draft buffer."
347   )
348
349 (defvar mew-mime-content-type-binary-list
350   '("Application/Octet-Stream"
351     "Application/Pdf"
352     "Image/Jpeg" "Image/Gif" "Image/Tiff"
353     "Image/x-xwd" "Image/x-xbm" "Image/x-xpm" 
354     "Image/x-bmp" "Image/Png" "Audio/Basic" "Video/Mpeg")
355   "Content-Type: list to save as binary file in mew-summary-save on Mule.")
356
357 (defvar mew-mime-content-type-others-list
358   '("Message/Rfc822" "Message/External-body"))
359
360 (defvar mew-mime-content-type-list
361   (append mew-mime-content-type-text-list
362           mew-mime-content-type-multipart-list
363           mew-mime-content-type-binary-list
364           mew-mime-content-type-others-list)
365   "Candidate of Content-Type: when CT: is changed in draft buffer.")
366
367 (defvar mew-mime-content-type-ignore-cdp
368   '("Message/.*" "Multipart/.*")
369   "Content-Type: list to ignore for insertion Content-Disposition:.")
370
371 ;;
372 ;; Separators
373 ;;
374
375 (defvar mew-path-separator "/")
376 (defvar mew-header-separator "----")
377 (defvar mew-eoh (format "^\\(%s\\|\\)$" (regexp-quote mew-header-separator)))
378 (defvar mew-lwsp "^[ \t]")
379 (defvar mew-address-separator ":, \t\n")
380 (defvar mew-page-delimiter "^\^L")
381 (defvar mew-keyval "^\\([^ \t:]+:?\\)[ \t]*")
382 ;; "^\\([^ \t:]+:?\\)[ \t]*\\(.*\\)$" faces a stupid error. 
383 ;; "$" doesn't mean end-of-line if the second match is empty, sigh.
384
385 ;;
386 ;; Limits
387 ;;
388
389 (defvar mew-file-max-size 100000
390   "*The max size of messages. If the size of a message is greater
391 than mew-file-max-size, Mew skips MIME analysis.")
392
393 (defvar mew-header-max-length 100
394   "*If the length of a header exceeds this value, 
395 it is not arranged nor MIME decoded.
396 See also mew-header-max-depth.")
397
398 (defvar mew-header-max-depth 50
399   "*A value to decide loop depth for header field syntax analysis.
400 It was known as mew-loop-depth.
401 See also mew-header-max-length.")
402
403 (defvar mew-references-max-count 3
404   "*A value for the max number of message IDs in References: when reply.
405 Non-integer means no limit.")
406
407 (defvar mew-lisp-max-length 1000
408   "*Mew saves an internal lisp structure to a file truncating
409 to this file.")
410
411 (defvar mew-expand-max-depth 5
412   "*A value to limit Addrbook expansion loop.")
413
414 ;; 
415 ;; Mail Addresses
416 ;;
417
418 (defvar mew-mail-domain-list nil
419   "*Your e-mail address domain list like 
420 (\"Mew.org\" \"iijlab.net\").
421 They are used for mail-domain completion in Draft mode(C-cTAB)")
422
423 (defvar mew-mail-domain (or (car mew-mail-domain-list) "")
424   "*Your e-mail address domain.")
425
426 (defvar mew-mail-address-list nil
427   "*The addresses included in this list never appear on the Cc:
428 field on a draft buffer.")
429
430 (cond 
431  ((string= mew-mail-domain "")
432   (defvar mew-mail-address (user-login-name)))
433  (t
434   (defvar mew-mail-address (concat (user-login-name) "@" mew-mail-domain))))
435
436 ;;
437 ;; Window
438 ;;
439
440 (defvar mew-window-configuration 
441   '((summary (1  0))
442     (message (8 31))
443     (draft   (1  0)))
444   "*Ratio of windows")
445
446 (defvar mew-window-use-full nil
447   "*Dynamic window configuration when nil. This variable will be obsolated
448 because mew will support mew-window-percent(e.g 50, 100, etc.).")
449
450 ;;
451 ;; Appearance
452 ;;
453
454 (defvar mew-mode-line-id '("Mew: %12b")
455   "*A default value of mode-line-buffer-identification for each Mew mode.")
456
457 (defvar mew-multipart-icon-position 'right
458   "*Position where multipart icons are displayed. 
459 If 'left, displayed at the left size of the default toolbar.
460 If 'right, displayed at the right size of the default toolbar.
461 Otherwise, not displayed.")
462
463 ;; Low level
464 (defvar mew-folder-list-function 'mew-folder-list)
465
466 ;;
467 ;; Summary mode
468 ;;
469
470 (defvar mew-decode-quoted nil
471   "*Decode quoted MIME encoded-word when *non-nil*. 
472   Skip decode when nil.")
473
474 (defvar mew-summary-cache-use t
475   "*If *non-nil*, insert mew-summary-cache-file into Summary mode buffer 
476 when the Summary mode is visited and it does not exist in buffer. 
477 mew-summary-cache-file is automatically saved on inc and scan.")
478
479 (defvar mew-cache-prefetch t
480   "*If non-nil, Mew prefetches the next message in Summary mode
481 and analyzes it while you are reading the current message.")
482
483 (defvar mew-cache-prefetch-remote t
484   "*If non-nil, Mew prefetches the next message in remote folder.")
485
486 (defvar mew-cache-size 10
487   "*Number of buffer for message cache.")
488
489 (defvar mew-summary-cache-file ".mew-cache"
490   "*Cache file for Summary mode contents.")
491
492 (defvar mew-summary-touch-file ".mew-touch"
493   "*Time-stamp file for message folders.")
494
495 (defvar mew-window-home-buffer "*scratch*"
496   "*Buffer name to return if window stack is empty.")
497
498 (defvar mew-summary-show-direction 'next
499   "*Direction for SPC at end of message. 
500 'up 'down 'next(current direction) 'stop.
501 Other values are considered as 'stop.
502 See also 'mew-summary-mark-direction'.")
503
504 (defvar mew-summary-mark-direction 'next
505   "*Direction after marking a message
506 'up 'down 'next(current direction) 'stop.
507 Other values are considered as 'stop.
508 See also 'mew-summary-show-direction'.")
509
510 (defvar mew-summary-trace-directory t
511   "*If non-nil, change to the folder directory when 
512 mew-summary-goto-folder.")
513
514 (defvar mew-summary-recenter-p t
515   "*If *non-nil*, the current message is recentered in Summary mode when
516 displayed.")
517
518 (defvar mew-summary-scan-width nil
519   "*If *non-nil*, used as --width value.")
520
521 (defvar mew-save-dir mew-home
522   "*The default directory to save messages or parts in Summary mode.
523 See also 'mew-copy-dir'.")
524
525 (defvar mew-summary-preserve-dir nil
526   "*If non-nil, the previous directory is used as the default 
527 directory for save, etc.  See also 'mew-draft-preserve-dir'.")
528
529 (defvar mew-summary-jump-message-then-display t
530   "*If non-nil 'mew-summary-jump-message' displays the message
531 where the cursor jumped.")
532
533 (defvar mew-summary-jump-top-then-display t
534   "*If non-nil 'mew-summary-jump-top' displays the top message
535 where the cursor jumped to the top.")
536
537 (defvar mew-summary-jump-bottom-then-display t
538   "*If non-nil 'mew-summary-jump-bottom' displays the bottom message
539 where the cursor jumped to the bottom.")
540
541 ;;
542 ;; Message mode
543 ;;
544
545 (defvar mew-end-of-message-string "[End of message]"
546   "*A value inserted on the end of message buffer if *non-nil*.")
547
548 (defvar mew-end-of-part-string "[Message is continued]"
549   "*A value inserted on the end of message buffer if *non-nil*.")
550
551 (defvar mew-break-pages t
552   "*If *non-nil*, a message is broken by mew-page-delimiter.")
553
554 (defvar mew-field-other-visible t
555   "*If *non-nil*, fields which are not found in 'mew-field-spec'
556 are displayed after visible fields. Otherwise they are
557 hidden before visible fields (and after invisible fields).")
558
559 ;;
560 ;; Draft mode
561 ;;
562
563 (defvar mew-reply-to nil
564   "*A value inserted into Reply-To: field in Draft mode if *non-nil*.")
565
566 (defvar mew-fcc nil
567   "*A value inserted into Fcc: field in Draft mode if *non-nil*.")
568
569 (defvar mew-cc nil
570   "*A value inserted into Cc: field in Draft mode if *non-nil*.")
571
572 (defvar mew-dcc nil
573   "*A value inserted into Dcc: field in Draft mode if *non-nil*.")
574
575 (defvar mew-from-list nil
576   "*A list of From: for circular completion in Draft mode.")
577
578 (defvar mew-from (car mew-from-list)
579   "*A value inserted into From: field in Draft mode if *non-nil*.")
580
581 (defvar mew-header-alist nil
582   "*Alist of key and value pair for header field to be inserted on draft.
583 '((\"X-fingerprint:\" . \"6B 63 38 88 67 5E 96 8E  CE A4 62 73 3F 11 64 94\")
584   (\"X-URL:\" . \"http://www.Mew.org/~kazu/\"))"
585   )
586
587 (defvar mew-require-final-newline t 
588   "*If non-nil, Mew adds a new line to the draft if ended without a new
589 line.")
590
591 (defvar mew-field-delete-common '("From " ">From")
592   "A field list to be deleted for reediting/resending/forwarding/saving.")
593
594 (defvar mew-field-delete nil) ;; backward compatibility
595
596 (defvar mew-field-delete-for-reediting
597   (or mew-field-delete
598       (list mew-date: mew-message-id: mew-from: mew-x-mailer: mew-config:
599             mew-mv: mew-received:
600             "Sender:" "Return-Path:" "Delivery-Date:" "Lines:"
601             "X-Dispatcher" "X-Resent-Dispatcher:" "X-UIDL:"
602             "Forwarded:" "Replied:"
603             "Resent" "Prev-Resent"))
604   "*A field list to be deleted when edit again.")
605
606 (defvar mew-field-delete-for-resending
607   (list mew-config: mew-received: "Return-Path:" "Delivery-Date:" "Lines:"
608         "Resent-" "X-Resent-"
609         "X-UIDL:" "Forwarded:" "Replied:")
610   "*A field list to be deleted when resending.")
611
612 (defvar mew-field-delete-for-forwarding ()
613   "*A field list to be deleted when forwarding.")
614
615 (defvar mew-field-delete-for-saving ()
616   "*A field list to be deleted when saving a message to a file.")
617
618 (defvar mew-copy-dir mew-home
619   "*The default directory from which attachments are copied in Draft mode.
620 See also 'mew-save-dir'.")
621
622 (defvar mew-draft-preserve-dir nil
623   "*If non-nil, the previous directory is used as the default 
624 directory for copy, etc.  See also 'mew-summary-preserve-dir'.")
625
626 (defvar mew-draft-mode-auto-save t
627   "*If t, a draft is repeatedly saved to 'buffer-auto-save-file-name'
628 by 'do-auto-save'. If automatic saving is enabled and Emacs is crashed,
629 the '.save-' file remains. If this value is nil, automatic saving does
630 not work resulting that no garbage file remains.")
631
632 (defvar mew-draft-backup-file ".mew-backup")
633 (defvar mew-draft-syntax-file ".mew-syntax")
634 (defvar mew-draft-coverpage "CoverPage")
635
636 (defvar mew-attach-move-by-line nil
637   "*If non-nil, 'mew-attach-{next,previous}' move the cursor line by line.")
638
639 ;;
640 ;; IM Config
641 ;;
642
643 (defvar mew-config-guess-alist nil
644   "*If *non-nil*, this value is used to guess values of the Config: field.
645 The syntax is exactly the same as 'mew-refile-guess-alist'.")
646
647 (defvar mew-config-insert-when-prepared nil 
648   "*If *non-nil*, the Config: field is inserted according to
649 'mew-config-guess-alist' when the draft is prepared.")
650
651 (defvar mew-config-insert-when-composed nil
652   "*If *non-nil*, the Config: field is inserted according to
653 'mew-config-guess-alist' when the message is composed.")
654
655 (defconst mew-config-default "default"
656   "The default value for IM Config to avoid hard cording.
657 Do not change this value.")
658
659 (defvar mew-config-list nil
660   "A list of config cases appeared in .im/Config.
661 It is used for circular completion in Draft mode.
662 This variable is automatically set. Do NOT set this by yourself.")
663
664 (defvar mew-config-imget mew-config-default
665   "A config value specified to imget. Use '\\<mew-summary-mode-map>\\[mew-summary-config-imget] in Summary mode
666 to change this value with mew-config-list.")
667
668 ;;
669 ;; Completion
670 ;;
671
672 (defvar mew-fields
673   (list mew-from: mew-to: mew-cc: mew-subj: mew-dcc: mew-fcc: mew-bcc:
674         mew-reply-to: mew-followup-to: mew-newsgroups: mew-config:
675         mew-resent-to: mew-resent-cc: mew-resent-bcc: mew-resent-dcc:
676         mew-resent-from:)
677   "*Completion field list in Draft mode.")
678
679 (defvar mew-field-completion-switch
680   '(("To:"          . mew-complete-address)
681     ("Cc:"          . mew-complete-address)
682     ("Dcc:"         . mew-complete-address)
683     ("Bcc:"         . mew-complete-address)
684     ("Reply-To:"    . mew-complete-address)
685     ("Fcc:"         . mew-complete-folder)
686     ("Resent-To:"   . mew-complete-address)
687     ("Resent-Cc:"   . mew-complete-address)
688     ("Resent-Dcc:"  . mew-complete-address)
689     ("Resent-Bcc:"  . mew-complete-address)
690     ("Config:"      . mew-complete-config))
691   "*Completion function alist concerned with the key.")
692
693 (defvar mew-field-circular-completion-switch
694   '(("To:"          . mew-circular-complete-domain)
695     ("Cc:"          . mew-circular-complete-domain)
696     ("Dcc:"         . mew-circular-complete-domain)
697     ("Bcc:"         . mew-circular-complete-domain)
698     ("Reply-To:"    . mew-circular-complete-domain)
699     ("Resent-To:"   . mew-circular-complete-domain)
700     ("Resent-Cc:"   . mew-circular-complete-domain)
701     ("Resent-Dcc:"  . mew-complete-address)
702     ("Resent-Bcc:"  . mew-complete-address)
703     ("From:"        . mew-circular-complete-from)
704     ("Resent-From:" . mew-circular-complete-from)
705     ("Config:"      . mew-circular-complete-config))
706   "*Circular completion function alist concerned with the key.")
707
708 (defvar mew-field-expansion-switch
709   '(("To:"        . mew-expand-address)
710     ("Cc:"        . mew-expand-address)
711     ("Dcc:"       . mew-expand-address)
712     ("Bcc:"       . mew-expand-address)
713     ("Reply-To:"  . mew-expand-address)
714     ("Resent-To:" . mew-expand-address)
715     ("Resent-Cc:" . mew-expand-address)
716     ("Resent-Dcc:"  . mew-complete-address)
717     ("Resent-Bcc:"  . mew-complete-address))
718   "*Expansion function alist concerned with the key.")
719
720 ;;
721 ;; Citation
722 ;;
723
724 (defvar mew-cite-prefix "> "
725   "*Prefix of citation.")
726 (defvar mew-cite-hook nil
727   "*If you want to use super-cite, (setq mew-cite-hook 'sc-cite-original).")
728 (defvar mew-before-cite-hook nil
729   "Called in mew-summary-reply-with-citation before citation.")
730
731 (defvar mew-cite-prefix-function nil
732   "*Function called on citations. A good candidate is 
733 'mew-cite-prefix-username")
734
735 (defvar mew-cite-prefix-confirmp nil
736   "*If *non-nil*, ciattion prefix (such as 'kazu> ') is
737 confirmed to be used.")
738
739 (defvar mew-cite-fields (list mew-from: mew-subj: mew-date:)
740   "*The fields that you want to extract as citation label. 
741 If you change this valuable, you must change mew-cite-format.
742 The value of the first field becomes the first argment for mew-cite-format.
743 (e.g. The default first argment is a value of From: field.)
744 The value of the second field becomes the second argment for mew-cite-format.
745 ....
746 If this is nil, label is not generated.")
747
748 (defvar mew-cite-format "From: %s\nSubject: %s\nDate: %s\n\n"
749   "*Format for the citation label.")
750
751 (defvar mew-summary-reply-position 'body
752   "If 'body, the cursor locates in the beginning of the body. 
753 Otherwise, the cursor is after To:.")
754
755 (defvar mew-summary-reply-with-citation-position 'end
756   "If 'body, the cursor locates in the beginning of the body. 
757 If 'end, the cursor locates after the citation.
758 Otherwise, the cursor is after To:.")
759
760 (defvar mew-charset-input-method-alist nil
761   "*Alist of charset and input-method.  When a message is cited into
762 Draft mode on X/Emacs 20 or later AND the charset of the message is
763 found in this variable, the corresponding input-method is automatically
764 selected. An example configuration is as follows:
765 (setq mew-charset-input-method-alist
766       '((\"iso-8859-1\" . \"latin-1-postfix\")
767         (\"iso-8859-2\" . \"latin-2-postfix\")))
768 ")
769
770 ;;
771 ;; Signature
772 ;; 
773
774 (defvar mew-signature-file "~/.signature"
775   "*A signature file to be inserted in Draft mode. To support multiple
776 signature files, use 'c-sig.el'.")
777
778 (defvar mew-signature-insert-last nil 
779   "*If *non-nil*, the signature file is inserted in the last of body. 
780 Otherwise, it is inserted at the currect point. If you created multipart
781 and mew-signature-as-lastpart is *non-nil*, this variable is ignored.")
782
783 (defvar mew-signature-as-lastpart nil
784   "*If *non-nil*, the signature file is appended as the final part 
785 when you create multipart.")
786
787 (defvar mew-signature-description "My signature"
788   "*This variable is used as a description if the signature is appended
789 as the final part.")
790
791 ;;
792 ;; Temporary solution to decide To: when reply
793 ;;
794
795 (defvar mew-noreplyto-to-list (list mew-from:)
796   "*To: field list picked at mew-summary-reply if Reply-To: doesn't exist.")
797
798 (defvar mew-noreplyto-cc-list (list mew-to: mew-cc: mew-apparently-to:)
799   "Cc: field list picked at mew-summary-reply if Reply-To: doesn't exist.")
800
801 (defvar mew-replyto-to-list (list mew-reply-to: mew-from:)
802   "*To: field list picked at mew-summary-reply if Reply-To: exists.")
803
804 (defvar mew-replyto-cc-list (list mew-to: mew-cc: mew-apparently-to:)
805   "*Cc: field list picked at mew-summary-reply if Reply-To: exists.")
806
807 (defvar mew-fromme-to-list (list mew-to: mew-apparently-to:)
808   "*To: field list picked at mew-summary-reply if From: is me.")
809
810 (defvar mew-fromme-cc-list (list mew-cc:)
811   "*Cc: field list picked at mew-summary-reply if From: is me.")
812 ;;
813 ;; Folders
814 ;;
815
816 (defvar mew-folder-mode 448 ;; decimal for octal 0700
817   "Secure file mode for folders. 448(0700 in octal) is STRONGLY recommended
818 for privacy reasons.")
819
820 (defvar mew-file-mode 384 ;; decimal for octal 0600
821   "Secure file mode. 384(0600 in octal) is STRONGLY recommended
822 for privacy reasons.")
823
824 (defvar mew-use-folders-file-p t
825   "*If *non-nil*, Mew tries to load mew-folders-file to make bootup faster.
826 And '\\[universal-argument] \\[mew-status-update]' saves folder list to mew-folders-file.")
827
828 (defvar mew-folders-file ".folders"
829   "*A file to save folder list. It is used on start-up to
830 make start-up much faster.")
831
832 ;; xxx hard coding...
833 (defvar mew-folders-ignore '("+from" "+draft" "=")
834   "*Folder list to contain messages whose To: is you and From: is
835 personal, e.g. a friend. Directories under this folder is ignored
836 for refile guess.")
837
838 (defvar mew-folders-default-folder "+from"
839   "*A default folder used by mew-guess-by-default.
840 mew-guess-by-default append the From: value to it.
841 e.g. '+from/kazu'")
842
843 (defvar mew-folder-list-skip-pattern
844   (if (and (eq system-type 'windows-nt)
845            (not (featurep 'meadow)))
846       "^[0-9]+$"
847     nil)
848   "This value is used to make collecting folder faster.
849 If nil, Mew skips directories whose link count is 2, that is
850 they don't have subdirectories. Unfortunately, link count is
851 not available on some OSes. So, if a regular express pattern is 
852 set to this value, Mew skips directories whose name are matched
853 this value. A good example value is \"^[0-9]+$\",
854 especially for Windows (excluding WNT).")
855
856 (defvar mew-touch-folder-p nil) 
857
858 ;;
859 ;; Refile and delete
860 ;;
861
862 (defvar mew-msg-rm-policy 'trashonly
863   "*Set remove policy. You can set one of the followings:
864 'totrash   : Refile to the +trash folder if not in the +trash folder.
865              Just unmark the 'D' mark if in the +trash folder.
866 'always    : Really remove messages marked with 'D' always anyway.
867 'trashonly : Really remove messages marked with 'D' if in the +trash folder.
868              In other folders, refile to the +trash folder.
869 'uselist   : Really remove messages marked with 'D' if in a folder found
870              in @samp{mew-msg-rm-folder-list}. In other folders, refile 
871              to the +trash folder.
872 otherwise  : considered as 'totrash.")
873
874 (defvar mew-msg-rm-folder-list nil
875   "*Folder list to remove message really.")
876
877 ;;
878 ;; File
879 ;;
880
881 (defvar mew-file-append-p nil
882   "*If *non-nil*, a message or a part is appended to the existing file
883 on '\\<mew-summary-mode-map>\\[mew-summary-save]'. Otherwise overwrited.")
884
885 (defvar mew-temp-file-initial
886   (expand-file-name (user-login-name) (or (getenv "TMP")
887                                           (getenv "TEMP")
888                                           "/tmp"))
889   "*Hint to make a secure directory on the local file system. On
890 setup phase Mew make a secure directory from this variable and set
891 mew-temp-file a file name prefix contained the directory name. The
892 directory must be unreadable from others, otherwise it might become a
893 big security hole. And this directory must not be gained access
894 through network to prevent tire-tapping. Mew never uses 
895 'call-process-region' rather does use 'call-process' creating a
896 temporary file with mew-temp-file by itself.  If 'call-process-region'
897 is used, Emacs creates a temporary file (probably in /tmp). So bad
898 guys can wiretap the temporary file.")
899
900 (defvar mew-delete-temp-file t
901   "*If *non-nil*, delete temporary files when external commands terminate.")
902
903 ;;
904 ;; Demo
905 ;;
906
907 (defvar mew-demo t
908   "*Mew demo is displayed at boot time if *non-nil*.")
909
910 (defvar mew-demo-picture mew-xemacs-p
911   "*A picture of cats is displayed if *non-nil* on XEmacs.")
912
913 (defvar mew-icon-mew "Mew.png")
914 (defvar mew-icon-mew-mono "Mew.xbm")
915 (defvar mew-icon-mew-mule-bitmap-image "Mew.img")
916
917 (defvar mew-logo nil)
918
919 ;;
920 ;; Ask?
921 ;; 
922
923 (defvar mew-ask-cc t
924   "*Prompt user for CC: field if *non-nil*.")
925
926 (defvar mew-ask-subject nil
927   "*Prompt user for Subject: field when send if *non-nil*.")
928
929 (defvar mew-ask-range nil)
930
931 (defvar mew-ask-newsgroups nil
932   "*If *non-nil*, prompt user if he/she want to include Newsgroups: field.")
933
934 (defvar mew-ask-config nil
935   "*If *non-nil*, prompt user if he/she want to include/change Config: 
936 field.")
937
938 (defvar mew-ask-cite-prefix nil
939   "*If *non-nil*, ask citation prefix when cite a message.")
940
941 (defvar mew-ask-pack t
942   "*If *non-nil*, ask whether or not you really want to pack.")
943
944 (defvar mew-ask-send t
945   "*If *non-nil*, ask whether or not you really want to send the message
946 which you composed without explicit C-cC-m.")
947
948 (defvar mew-ask-flush-queue nil
949   "*If *non-nil*, ask whether or not you really want to flush queue.")
950
951 ;;
952 ;; Field Magic
953 ;;
954
955 (defvar mew-reply-string "Re: ")
956 (defvar mew-reply-regex "^Re:")
957 (defvar mew-forward-string "Fw: ")
958 (defvar mew-forward-regex "^\\(Fw\\|Forward\\):")
959
960 ;;
961 ;; Use
962 ;;
963
964 (defvar mew-use-imap nil
965   "*If nil, both 'immv' and 'imrm' are called synchronously for speed when
966 '\\<mew-summary-mode-map>\\[mew-summary-exec] is typed. If *non-nil*, they are called asynchronously to catch 
967 user's password for IMAP operation.")
968
969 (defvar mew-summary-imap-cache nil
970   "*If *non-nil*, use mew-summary-cache-file for imap folders.")
971
972 (defvar mew-summary-imap-nocache-folders '("%inbox" "%#mhinbox" "%#mh/inbox")
973   "*List of imap folders, not create mew-summary-cache-file.")
974
975 (defvar mew-use-immv nil
976   "*If non-nil, Mew uses 'immv' for refile. Otherwise, Mew 
977 refiles messages by Elisp-version code.")
978
979 (defvar mew-use-text/enriched (equal mew-mule-ver 3)
980   "*If non-nil, Mew highlights enriched format text messages.")
981
982 (defvar mew-use-config-imget-for-draft nil
983   "*If non-nil, Mew inserts the Config: field with a non-default
984 value in Draft mode.")
985
986 (defvar mew-use-symbolic-link-for-forwarding nil
987   "*If nil, messages to be forwarded is copied to +draft when
988 '\\<mew-summary-mode-map>\\[mew-summary-forward]' and '\\[mew-summary-multi-forward]' are used. Otherwise, symbolic links are
989 created (if the feature is provided).")
990
991 (defvar mew-use-timer t
992   "*If non-nil, timer is used to expire cached passphrases.")
993
994 (defvar mew-use-cached-passwd nil
995   "*if non-nil, password for imget, which you inputed, is cached.")
996
997 (defvar mew-use-pgp-cached-passphrase nil
998   "*if non-nil, PGP passphrase, which you inputed, is cached to be used
999 for further PGP processes.")
1000
1001 (defvar mew-use-imget-assoc nil
1002   "*if non-nil, password is asked like
1003         Password (proto/auth:user@host):.
1004 Otherwise, asked like
1005         Password (case):.
1006 ")
1007
1008 ;;
1009 ;; X face
1010 ;;
1011
1012 (defvar mew-x-face-filter (list mew-prog-uncompface "ikon2xbm"))
1013 (defvar mew-x-face-prog "xv")
1014 (defvar mew-x-face-args nil)
1015 (defvar mew-x-face-file "~/.xface"
1016   "*If *non-nil* and the file exists, X-Face: fields is inserted.")
1017
1018 ;;
1019 ;; Auto
1020 ;;
1021
1022 (defvar mew-auto-get t
1023   "If *non-nil*, Mew gets messages from your spool automatically. 
1024 \"\\[universal-argument] \\[mew]\" equals to \"\\[mew]\" with 'mew-auto-get'
1025 revered.")
1026  
1027
1028 (defvar mew-auto-flush-queue nil
1029   "If *non-nil* and if there are queued messages in  IM's QueueDir,
1030 they are flushed at 'imget'(i.e. '\\<mew-summary-mode-map>\\[mew-summary-get]'). This idea saves money in 
1031 dial up environment.")
1032
1033 ;;
1034 ;; Pick and Sort
1035 ;;
1036
1037 (defvar mew-pick-default-field nil
1038   "*Default prefix string to be appeared when inputing a pick pattern.
1039 A good example is \"from=\".")
1040
1041 (defvar mew-pick-duplicate-msgid      "dup-msgid")
1042 (defvar mew-pick-duplicate-subj-msgid "dup-subj-msgid")
1043
1044 (defvar mew-pick-field-list
1045   (list "head=" "body=" "all="
1046         "to=" "cc=" "subject=" "dcc=" "fcc=" "bcc=" "date="
1047         "reply-to=" "followup-to=" "from=" "newsgroups="
1048         mew-pick-duplicate-msgid mew-pick-duplicate-subj-msgid)
1049   "*A list of key for pick pattern.")
1050
1051 (defvar mew-sort-default-key "date"
1052   "*Default sort key when inputing a sort key. 
1053 Its format is key:mode where more is found in 'mew-sort-mode'.")
1054
1055 (defvar mew-sort-default-key-alist nil
1056   "*Alist of (folder . sort-key) to decide a default sort-key
1057 of a specific folder. An example is follows:
1058 (setq mew-sort-default-key-alist
1059       '((\"+tmp/beginners\" . \"x-sequence\")
1060         (\"+tmp/elips\" . \"x-mail-count\")))")
1061
1062 (defvar mew-sort-key-alist
1063   '(("date" . "date") ("subject") ("from") ("to") ("newsgroups")
1064     ("posted" . "date") ("x-sequence" . "num") ("x-mail-count" . "num")
1065     ("x-ml-count" . "num"))
1066   "*List of fields for 'mew-summary-sort'.
1067 Each element is (FIELD-NAME) or (FIELD-NAME . MODE).
1068 MODE is one of \"date\" (sort by chronological order) or
1069                \"num\"  (sort by numerical order) or
1070                \"text\" (sort by alphabetical order) or
1071                \"ml\"   (modify subject).
1072 (nil means \"text\").")
1073
1074 (defvar mew-sort-modes '("date" "num" "text" "ml"))
1075
1076 ;;
1077 ;; Range
1078 ;;
1079
1080 (defvar mew-input-range-list
1081   '("update" "all" "first:" "prev:" "next:" "last:")
1082   "*A list used by range completion.")
1083
1084 (defvar mew-range-auto-alist 
1085   '(("^+draft" . "all") (".*" . "update"))
1086   "*Alist of folder-range pair for automatic scan.")
1087
1088 (defvar mew-range-interactive-alist
1089   '(("^+draft" . "all") (".*" . "update"))
1090   "*Alist of folder-range pair for interactive scan.")
1091
1092 ;;
1093 ;; PGP Public key fetch
1094 ;;
1095
1096 (defvar mew-pgp-keyserver-url-template
1097   "http://pgp5.ai.mit.edu:11371/pks/lookup?op=get&search=%s"
1098 ;;  "http://pgp.nic.ad.jp/cgi-bin/pgpsearchkey.pl?op=get&search=%s"
1099   )
1100
1101 (defvar mew-x-pgp-key-list
1102   '("x-pgp-key:" "x-pgp-key-url:" "x-pgp-public-key:" "x-pgp-public-key-url:"
1103     "x-pgp5-key:" "x-pgp5-key-url:" "x-pgp5-public-key:"
1104     "x-pgp5-public-key-url:" "x-public-key:"))
1105    
1106 (defvar mew-pgp-fetch-key-process nil)
1107
1108 ;;
1109 ;; Marks
1110 ;;
1111
1112 (defvar mew-mark-multi  ?@)
1113 (defvar mew-mark-review ?*)
1114 (defvar mew-mark-delete ?D)
1115 (defvar mew-mark-refile ?o) ;; do you like "^"?
1116 (defvar mew-mark-tmp    ?%) ;; temporary use only.
1117
1118 ;;
1119 ;; Highlight
1120 ;;
1121
1122 (defvar mew-cursor-mark ">"
1123   "*The mark in the beginning of the cursor line if
1124 mew-use-cursor-mark is *non-nil*. ")
1125 (defvar mew-use-cursor-mark nil
1126   "*If *non-nil*, show mew-cursor-mark in the beginning of the cursor line.
1127 This is convenient if underline is not available.")
1128
1129 (defvar mew-use-highlight-cursor-line t
1130   "*Put underline on the current line in Summary mode.")
1131 (defvar mew-use-highlight-mouse-line mew-xemacs-p
1132   "*Paint the line where mouse locates in Summary mode.")
1133 (defvar mew-use-highlight-mark t
1134   "*Paint marked lines in Summary mode.")
1135 (defvar mew-use-highlight-header t
1136   "*Paint header in Message and Draft mode.")
1137 (defvar mew-use-highlight-body nil
1138   "*Paint body in Message and Draft mode.")
1139 (defvar mew-use-highlight-url t
1140   "*Emphasize URL lines in Message mode.")
1141 (defvar mew-use-highlight-url-regex
1142   "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]"
1143   "*Regular expression to find URL.")
1144
1145 (defvar mew-use-highlight-x-face mew-xemacs-p
1146   "*Iconify X-Face: on XEmacs in Message mode.")
1147
1148 (defvar mew-highlight-body-max-line 200)
1149
1150 (defvar mew-highlight-url-max-size 10000
1151   "*Use bold font at url maximize size.
1152 If nil, all contents are parsed.")
1153
1154 ;;
1155 ;; Styles and colors
1156 ;;
1157
1158 (defvar mew-highlight-cursor-line-face 'underline
1159   "*Face to highlight the cursor line in Summary and Virtual mode")
1160 (defvar mew-highlight-mouse-line-function
1161   (function mode-motion-highlight-line)
1162   "*A function to highlight the mouse line in Summary and Virtual mode")
1163 (defvar mew-highlight-url-face         'bold
1164   "*Face to highlight URL in Message mode")
1165 (defvar mew-highlight-url-mouse-face   'highlight
1166   "*Mouse face to highlight URL in Message mode")
1167
1168 (defvar mew-highlight-header-face-list
1169   '(mew-highlight-header-face-subject
1170     mew-highlight-header-face-from
1171     mew-highlight-header-face-to
1172     mew-highlight-header-face-key
1173     mew-highlight-header-face-private
1174     mew-highlight-header-face-important
1175     mew-highlight-header-face-marginal
1176     mew-highlight-header-face-xmew
1177     mew-highlight-header-face-xmew-bad)
1178   "*A list of face symbol name to highlight header.
1179 Each name should be 'mew-highlight-header-face-<word>'.
1180 Each face will be created from 'mew-highlight-header-style-<word>' and
1181 'mew-highlight-header-color-<word>'. These faces can be used in
1182 'mew-field-spec'.")
1183
1184 (defvar mew-highlight-header-style-subject   'bold)
1185 (defvar mew-highlight-header-style-from      'bold)
1186 (defvar mew-highlight-header-style-to        'bold)
1187 (defvar mew-highlight-header-style-key       'bold)
1188 (defvar mew-highlight-header-style-private   'bold)
1189 (defvar mew-highlight-header-style-important 'bold)
1190 (defvar mew-highlight-header-style-marginal  'bold)
1191 (defvar mew-highlight-header-style-xmew      'bold)
1192 (defvar mew-highlight-header-style-xmew-bad  'bold)
1193
1194 (defvar mew-highlight-header-color-subject   "firebrick")
1195 (defvar mew-highlight-header-color-from      "Purple")
1196 (defvar mew-highlight-header-color-to        "DarkOrange2")
1197 (defvar mew-highlight-header-color-key       "ForestGreen")
1198 (defvar mew-highlight-header-color-private
1199   (if (or mew-xemacs-p (fboundp 'frame-face-alist))
1200       (face-foreground 'default)
1201     nil))
1202 (defvar mew-highlight-header-color-important "Blue")
1203 (defvar mew-highlight-header-color-marginal  "gray50")
1204 (defvar mew-highlight-header-color-xmew      "chocolate")
1205 (defvar mew-highlight-header-color-xmew-bad  "red")
1206
1207 (defvar mew-highlight-body-face-list
1208   '(mew-highlight-body-face-quote
1209     mew-highlight-body-face-comment)
1210   "*A list of face symbol name to highlight body.
1211 Each name should be 'mew-highlight-body-face-<word>'.
1212 Each face will be created from 'mew-highlight-body-style-<word>' and
1213 'mew-highlight-body-color-<word>'. These faces can be used in
1214 'mew-highlight-body-keywords'.")
1215
1216 (defvar mew-highlight-body-style-quote   'default)
1217 (defvar mew-highlight-body-style-comment 'default)
1218
1219 (defvar mew-highlight-body-color-quote   "ForestGreen")
1220 (defvar mew-highlight-body-color-comment "gray50")
1221
1222 ;; xxx hard coding...
1223 (defvar mew-highlight-mark-folder-list '("+inbox")
1224   "*A folder list to highlight marked lines. If 't, 
1225 marked lines in all folders are highlight. ")
1226
1227 (defvar mew-highlight-mark-face-list
1228   '(mew-highlight-mark-face-review
1229     mew-highlight-mark-face-multi
1230     mew-highlight-mark-face-delete
1231     mew-highlight-mark-face-refile)
1232   "*A list of face symbol name to highlight marked lines.
1233 Each name should be 'mew-highlight-mark-face-<word>'.
1234 Each face will be created from 'mew-highlight-mark-style-<word>' and
1235 'mew-highlight-mark-color-<word>'. These faces can be used in
1236 'mew-highlight-mark-keywords'.")
1237
1238 (defvar mew-highlight-mark-style-review 'default)
1239 (defvar mew-highlight-mark-style-multi  'default)
1240 (defvar mew-highlight-mark-style-delete 'default)
1241 (defvar mew-highlight-mark-style-refile 'default)
1242
1243 (defvar mew-highlight-mark-color-review "Blue")
1244 (defvar mew-highlight-mark-color-multi  "Purple")
1245 (defvar mew-highlight-mark-color-delete "firebrick")
1246 (defvar mew-highlight-mark-color-refile "ForestGreen")
1247
1248 (defvar mew-field-spec
1249   '(("^Resent-\\(From\\|To\\|Cc\\|Date\\)" t
1250      mew-highlight-header-face-important
1251      mew-highlight-header-face-important)
1252     ("^Subject:$" t
1253      mew-highlight-header-face-important
1254      mew-highlight-header-face-subject)
1255     ("^From:$" t
1256      mew-highlight-header-face-important
1257      mew-highlight-header-face-from)
1258     ("^\\(To\\|Apparently-To\\):$" t
1259      mew-highlight-header-face-important
1260      mew-highlight-header-face-to)
1261     ("^Cc:$" t
1262      mew-highlight-header-face-important
1263      mew-highlight-header-face-to)
1264     ("^Newsgroups:$" t
1265      mew-highlight-header-face-important
1266      mew-highlight-header-face-to)
1267     ("^Date:$" t)
1268     ("^Reply-To:$" t)
1269     ("^X-Mailer:$" t)
1270     ("^X-Mew:$" t
1271      mew-highlight-header-face-important
1272      mew-highlight-header-face-xmew)
1273     ("^\\(Received\\|Return-Path\\|Sender\\|Errors-To\\):$" nil)
1274     ("^\\(Message-Id\\|Posted\\|In-Reply-To\\|References\\|Precedence\\):$" nil)
1275     ("^Delivered-" nil)
1276 ;;    ("^Content-" t)
1277     ("^\\(Mime-Version\\|Lines\\):$" nil)
1278     ("^From$" nil)
1279     ("^X-" nil
1280      mew-highlight-header-face-private
1281      mew-highlight-header-face-marginal))
1282   "*An alist of field spec for Message mode. Each spec
1283 consists of field-regular-expression, visible-p, face-for-key, 
1284 and face-for-value. Fields whose visible-p is t are displayed in 
1285 Message mode in the defined order. Fields whose visible-p is nil are
1286 hidden in Message mode. Type DEL to see them. Fields not matched
1287 to field-regular-expressions are operated by the value of
1288 'mew-field-other-visible'. If face-for-key is omitted, 
1289 'mew-highlight-header-face-key' is used. If face-for-value is not
1290 present, mew-highlight-header-face-marginal is used.")
1291
1292 (defvar mew-highlight-body-keywords
1293   '(("^[ \t]*\\(\\w*[A-Za-z0-9'-]*[>|]+.*\\)"
1294      mew-highlight-body-face-quote)
1295     ("^#+.*"
1296      mew-highlight-body-face-comment))
1297   "*A list of ('body-key-regex' face-for-body).
1298 This is used to highlight body.")
1299
1300 (defvar mew-highlight-body-keywords-regex nil)
1301
1302 (defvar mew-highlight-mark-keywords
1303   (list (cons mew-mark-review 'mew-highlight-mark-face-review)
1304         (cons mew-mark-multi  'mew-highlight-mark-face-multi)
1305         (cons mew-mark-delete 'mew-highlight-mark-face-delete)
1306         (cons mew-mark-refile 'mew-highlight-mark-face-refile))
1307   "A list of mark-face pair to used in Summary mode where its folder name
1308 is found in 'mew-highlight-mark-folder-list'.")
1309
1310 ;;
1311 ;; Error
1312 ;;
1313
1314 (defvar mew-error-unknown-charset "**UNKNOWN CHARSET**")
1315 (defvar mew-error-illegal-base64 " **BASE64 ENCODING ERROR** ")
1316 (defvar mew-error-charset-unknown "unknown")
1317
1318 ;;
1319 ;; MIME control
1320 ;;
1321
1322
1323 (defvar mew-mime-content-type
1324   '(("multipart/*" nil         nil     nil            mew-icon-multipart)
1325     ("audio/basic" "\\.au$"    mew-b64 mew-prog-audio mew-icon-audio)
1326     ("image/gif"   "\\.gif$"   mew-b64 mew-prog-gif   mew-icon-image)
1327     ("image/tiff"  "\\.tiff$"  mew-b64 mew-prog-tiff  mew-icon-image)
1328     ("image/jpeg"  "\\.jpe?g$" mew-b64 mew-prog-jpeg  mew-icon-image)
1329     ("image/png"   "\\.png$"   mew-b64 mew-prog-png   mew-icon-image)
1330     ("image/x-xwd" "\\.xwd$"   mew-b64 mew-prog-xwd   mew-icon-image)
1331     ("image/x-xbm" "\\.xbm$"   mew-b64 mew-prog-xbm   mew-icon-image)
1332     ("image/x-xpm" "\\.xpm$"   mew-b64 mew-prog-xpm   mew-icon-image)
1333     ("image/x-bmp" "\\.bmp$"   mew-b64 mew-prog-bmp   mew-icon-image)
1334     ("image/.*"    "^$"        mew-b64 mew-prog-image mew-icon-image)
1335     ("video/mpeg"  "\\.mpe?g$" mew-b64 mew-prog-mpeg  mew-icon-video)
1336     ("message/rfc822"          "^[0-9]+$" nil
1337      mew-prog-rfc822          mew-icon-message/rfc822)
1338     ("message/external-body"   "\\.ext$"  nil
1339      mew-prog-external-body   mew-icon-message/external-body)
1340     ("message/delivery-status" "^$"       nil
1341      mew-prog-delivery-status mew-icon-text)
1342     ("application/postscript" "\\.ps$"   mew-qp
1343      mew-prog-postscript mew-icon-application/postscript)
1344     ("application/pdf"        "\\.pdf$"  mew-b64
1345      mew-prog-pdf        mew-icon-application/postscript)
1346     ("application/pgp-keys"    "\\.pka$" nil
1347      mew-prog-pgp-keys   mew-icon-unknown)
1348     ("application/octet-stream"
1349       "\\.tar\\.?g?z?$\\|\\.tgz$\\|\\.gz$\\|\\.Z$\\|\\.lzh$\\|\\.zip$\\|\\.bin$\\|\\.pgp$"
1350       mew-b64 mew-prog-octet-stream mew-icon-application/octet-stream)
1351     ("text/html"     "\\.html$" nil     mew-prog-html      mew-icon-text)
1352     ("text/enriched" "\\.rtf$"  nil     mew-prog-enriched  mew-icon-text)
1353     ;; must be here
1354     ("text/plain"    ".*"       nil     mew-prog-plain     mew-icon-text)
1355     ("text/.*"       "^$"       nil     mew-prog-text      mew-icon-text)
1356     (".*" "^$" nil mew-prog-octet-stream mew-icon-unknown))
1357   "(content-type filename <encoding> <prog> <icon>)"
1358    )
1359
1360 ;;
1361 ;; Addrbook
1362 ;;
1363
1364 (defvar mew-use-auto-alias t
1365   "*If non-nil, addresses on the To: and Cc: field in Draft mode
1366 will be automatically leaned as alias.")
1367
1368 (defvar mew-alias-comment-regex "^;.*$\\|#.*$"
1369   "*Regular expression for the old Aliases.")
1370
1371 (defvar mew-addrbook-comment-regex "^;.*$\\|#.*$"
1372   "*Regular expression for Addrbook.")
1373
1374 (defvar mew-addrbook-unexpand-regex "-$"
1375   "Regular expression not to expand in Draft mode.
1376 For example, consider a shortname 'friends-' which is
1377 to be expanded into many addresses. You may want to retain
1378 'friends-' of 'To: party attendance:friends-;'.")
1379
1380 (defvar mew-addrbook-append-domain-p t
1381   "If non-nil, addresses, which don't have domain part in a header,
1382 will be appended 'mew-mail-domain' when composing.")
1383
1384 (defvar mew-addrbook-override-by-newone t
1385   "If non-nil, the 'user' entry in 'mew-alias-auto-alist'
1386 is override by a new entry of (user different-address). 
1387 This means that addresses in To: and Cc: in Draft mode are
1388 always learned with an exception 'user' is defined in Addrbook.
1389 If nil,  the old 'user' entry remains.")
1390
1391 (defvar mew-addrbook-switch
1392   '((shortname . mew-addrbook-shortname-get)
1393     (address   . identity)
1394     (username  . mew-addrstr-extract-user)
1395     (nickname  . mew-addrbook-nickname-get)
1396     (name      . mew-addrbook-name-get))
1397   "Function database to get each field of Addrbook.")
1398
1399 (defvar mew-addrbook-for-cite-label nil
1400   "*How to replace the From: value in cite label
1401 with Addrbook. See 'mew-addrbook-switch'.")
1402 (defvar mew-addrbook-for-cite-prefix 'username
1403   "*How to replace the From: value in cite prefix
1404 with Addrbook. See 'mew-addrbook-switch'.")
1405 (defvar mew-addrbook-for-address-expansion 'name
1406   "*How to replace an address in address fields
1407 with Addrbook. See 'mew-addrbook-switch'.")
1408
1409 ;;(defvar mew-addrbook-for-summary 'nickname) ;; in the future...
1410
1411 ;;
1412 ;; Privacy
1413 ;;
1414
1415 (defvar mew-privacy-database
1416   (list
1417    (list 'pgp-signature  (list (list mew-ct-mls mew-ct-pgs)) "PS")
1418    (list 'pgp-encryption (list (list mew-ct-mle mew-ct-pge)) "PE")
1419    (list 'pgp-signature-encryption
1420          (list (list mew-ct-mls mew-ct-pgs) (list mew-ct-mle mew-ct-pge))
1421          "PSPE")
1422    (list 'pgp-encryption-signature
1423          (list (list mew-ct-mle mew-ct-pge) (list mew-ct-mls mew-ct-pgs))
1424          "PEPS"))
1425   "*Alist of key, a list of privacy Content-Type, and its mark.")
1426
1427 (defvar mew-protect-privacy-always nil
1428   "*If non-nil, a draft is to be protected according to
1429 'mew-protect-privacy-always-type'.")
1430
1431 (defvar mew-protect-privacy-always-type 'pgp-signature
1432   "*A type of privacy protection for all drafts.
1433 Currently, 'pgp-signature, 'pgp-encryption, 'pgp-signature-encryption,
1434 'pgp-signature-encryption, and nil are available. Since signature
1435 does not require receiver's public key, signature service may be
1436 appropriate for this value. ")
1437
1438 (defvar mew-protect-privacy-encrypted nil
1439   "*If non-nil, a draft replying a encrypted message is to be protected 
1440 according to 'mew-protect-privacy-encrypted-type'.")
1441
1442 (defvar mew-protect-privacy-encrypted-type 'pgp-encryption
1443   "*A type of privacy protection for drafts replying encrypted
1444 messages. Currently, 'pgp-signature, 'pgp-encryption, 
1445 'pgp-signature-encryption, 'pgp-signature-encryption, 
1446 and nil are available. ")
1447
1448
1449 (defvar mew-passwd-timer-unit 10
1450   "*Minutes of timer unit to cancel the cached passwords.")
1451
1452 (defvar mew-passwd-lifetime 2
1453   "*Number of 'mew-passwd-timer-unit' to cancel the cached passwords.")
1454
1455 (defvar mew-passwd-reset-timer t
1456   "If non-nil, a timer of a cached password is cleared when
1457 the password is used.")
1458
1459 ;;
1460 ;; Misc
1461 ;;
1462
1463 (defvar mew-print-function (function lpr-buffer))
1464
1465 (defvar mew-prog-text/html-arg-hack nil
1466   "*A kind of hook to modify arguments of mew-prog-text/html. 
1467 A good candidate is \"mew-prog-text/html-netscape-remote\".")
1468
1469 (defvar mew-prog-text/html-netscape-remote-format "openURL(%s)"
1470   "*A format used in \"mew-prog-text/html-netscape-remote\" to
1471 embed a temporary local HTML file. It must contains one %s, which
1472 will be replaced with the file name. Another example is 
1473 \"openURL(%s,new-windows)\".")
1474
1475 ;;
1476 ;; Environments
1477 ;;
1478
1479 (cond
1480  ((memq system-type '(OS/2 emx))
1481   (require 'mew-os2))
1482  ((eq system-type 'windows-nt)
1483   (require 'mew-win32))
1484  (t
1485   (require 'mew-unix))
1486  )
1487
1488 (provide 'mew-vars)
1489
1490 ;;; Copyright Notice:
1491
1492 ;; Copyright (C) 1996, 1997, 1998, 1999 Mew developing team.
1493 ;; All rights reserved.
1494
1495 ;; Redistribution and use in source and binary forms, with or without
1496 ;; modification, are permitted provided that the following conditions
1497 ;; are met:
1498 ;; 
1499 ;; 1. Redistributions of source code must retain the above copyright
1500 ;;    notice, this list of conditions and the following disclaimer.
1501 ;; 2. Redistributions in binary form must reproduce the above copyright
1502 ;;    notice, this list of conditions and the following disclaimer in the
1503 ;;    documentation and/or other materials provided with the distribution.
1504 ;; 3. Neither the name of the team nor the names of its contributors
1505 ;;    may be used to endorse or promote products derived from this software
1506 ;;    without specific prior written permission.
1507 ;; 
1508 ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
1509 ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1510 ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1511 ;; PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
1512 ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1513 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1514 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
1515 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
1516 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1517 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
1518 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1519
1520 ;;; mew-vars.el ends here