* TESTPAT: Use `\t' instead of raw TAB character.
[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 (eval-and-compile
57   (defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+")
58   (defconst ew-encoded-text-regexp "[!->@-~]+")
59 )
60 (defconst ew-encoded-word-regexp
61   (eval-when-compile
62     (concat (regexp-quote "=?")
63             "\\(" ew-token-regexp "\\)"
64             (regexp-quote "?")
65             "\\(" ew-token-regexp "\\)"
66             (regexp-quote "?")
67             "\\(" ew-encoded-text-regexp "\\)"
68             (regexp-quote "?="))))
69
70 ;;; utilities for variables.
71
72 (defun ew-dynamic-options ()
73   (cons
74    ew-default-mime-charset
75    (logior
76     (if ew-decode-sticked-encoded-word 1 0)
77     (if ew-decode-quoted-encoded-word 2 0)
78     (if ew-ignore-75bytes-limit 4 0)
79     (if ew-ignore-76bytes-limit 8 0)
80     (if ew-permit-sticked-comment 16 0)
81     (if ew-permit-sticked-special 32 0)
82     (if ew-remove-bare-crlf 64 0)
83     )))