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