Specify coding-system.
[elisp/flim.git] / ew-var.el
1 (provide 'ew-var)
2
3 ;;; user customizable variables.
4
5 (defvar ew-decode-sticked-encoded-word nil)
6 (defvar ew-decode-quoted-encoded-word nil)
7 (defvar ew-ignore-75bytes-limit nil)
8 (defvar ew-ignore-76bytes-limit nil)
9 (defvar ew-permit-sticked-comment nil)
10 (defvar ew-permit-sticked-special nil)
11
12 (defvar ew-remove-bare-crlf nil)
13 (defvar ew-default-mime-charset 'x-ctext)
14
15 ;;;
16 (defvar ew-decode-field-syntax-alist
17 '((from                 ew-scan-unibyte-std11 . ew:tag-mailbox+)
18   (sender               ew-scan-unibyte-std11 . ew:tag-mailbox)
19   (to                   ew-scan-unibyte-std11 . ew:tag-address+)
20   (resent-to            ew-scan-unibyte-std11 . ew:tag-address+)
21   (cc                   ew-scan-unibyte-std11 . ew:tag-address+)
22   (resent-cc            ew-scan-unibyte-std11 . ew:tag-address+)
23   (bcc                  ew-scan-unibyte-std11 . ew:tag-address*)
24   (resent-bcc           ew-scan-unibyte-std11 . ew:tag-address*)
25   (message-id           ew-scan-unibyte-std11)
26   (resent-message-id    ew-scan-unibyte-std11)
27   (in-reply-to          ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*)
28   (references           ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*)
29   (keywords             ew-scan-unibyte-std11 . ew:tag-phrase*)
30   (subject              ew-scan-unibyte-unstructured)
31   (comments             ew-scan-unibyte-unstructured)
32   (encrypted            ew-scan-unibyte-std11)
33   (date                 ew-scan-unibyte-std11)
34   (reply-to             ew-scan-unibyte-std11 . ew:tag-address+)
35   (received             ew-scan-unibyte-std11)
36   (resent-reply-to      ew-scan-unibyte-std11 . ew:tag-address+)
37   (resent-from          ew-scan-unibyte-std11 . ew:tag-mailbox+)
38   (resent-sender        ew-scan-unibyte-std11 . ew:tag-mailbox)
39   (resent-date          ew-scan-unibyte-std11)
40   (return-path          ew-scan-unibyte-std11)
41   (mime-version         ew-scan-unibyte-std11)
42   (content-type         ew-scan-unibyte-mime)
43   (content-transfer-encoding    ew-scan-unibyte-mime)
44   (content-id           ew-scan-unibyte-std11)
45   (content-description  ew-scan-unibyte-unstructured)
46   (content-disposition  ew-scan-unibyte-mime)
47   (approved             ew-scan-unibyte-std11 . ew:tag-address+)
48 ))
49
50 (defvar ew-decode-field-default-syntax '(ew-scan-unibyte-unstructured))
51
52 (defvar ew-parse-error-sit-for-seconds 0)
53
54 ;;; constants.
55
56 (defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+")
57 (defconst ew-encoded-text-regexp "[!->@-~]+")
58 (defconst ew-encoded-word-regexp
59   (concat (regexp-quote "=?")
60           "\\(" ew-token-regexp "\\)"
61           (regexp-quote "?")
62           "\\(" ew-token-regexp "\\)"
63           (regexp-quote "?")
64           "\\(" ew-encoded-text-regexp "\\)"
65           (regexp-quote "?=")))
66
67 ;;; utilities for variables.
68
69 (defun ew-dynamic-options ()
70   (cons
71    ew-default-mime-charset
72    (logior
73     (if ew-decode-sticked-encoded-word 1 0)
74     (if ew-decode-quoted-encoded-word 2 0)
75     (if ew-ignore-75bytes-limit 4 0)
76     (if ew-ignore-76bytes-limit 8 0)
77     (if ew-permit-sticked-comment 16 0)
78     (if ew-permit-sticked-special 32 0)
79     (if ew-remove-bare-crlf 64 0)
80     )))