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