(defvar ew-permit-sticked-comment nil)
(defvar ew-permit-sticked-special nil)
-(defvar ew-parse-error-sit-for-seconds 0)
-
-;;; anonymous function to decode ground string.
-;; NOTE: STR is CRLF-form and it should return as CRLF-form.
-(defvar ew-decode-us-ascii (lambda (str) (decode-coding-string str 'iso-latin-1-unix)))
+(defvar ew-remove-bare-crlf nil)
+(defvar ew-default-mime-charset 'x-ctext)
;;;
(defvar ew-decode-field-syntax-alist
(defvar ew-decode-field-default-syntax '(ew-scan-unibyte-unstructured))
+(defvar ew-parse-error-sit-for-seconds 0)
+
;;; constants.
-(defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+")
-(defconst ew-encoded-text-regexp "[!->@-~]+")
+(eval-and-compile
+ (defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+")
+ (defconst ew-encoded-text-regexp "[!->@-~]+")
+)
(defconst ew-encoded-word-regexp
- (concat (regexp-quote "=?")
- "\\(" ew-token-regexp "\\)"
- (regexp-quote "?")
- "\\(" ew-token-regexp "\\)"
- (regexp-quote "?")
- "\\(" ew-encoded-text-regexp "\\)"
- (regexp-quote "?=")))
+ (eval-when-compile
+ (concat (regexp-quote "=?")
+ "\\(" ew-token-regexp "\\)"
+ (regexp-quote "?")
+ "\\(" ew-token-regexp "\\)"
+ (regexp-quote "?")
+ "\\(" ew-encoded-text-regexp "\\)"
+ (regexp-quote "?="))))
;;; utilities for variables.
(defun ew-dynamic-options ()
- (list
- ew-decode-sticked-encoded-word
- ew-decode-quoted-encoded-word
- ew-ignore-75bytes-limit
- ew-ignore-76bytes-limit
- ew-permit-sticked-comment
- ew-permit-sticked-special))
+ (cons
+ ew-default-mime-charset
+ (logior
+ (if ew-decode-sticked-encoded-word 1 0)
+ (if ew-decode-quoted-encoded-word 2 0)
+ (if ew-ignore-75bytes-limit 4 0)
+ (if ew-ignore-76bytes-limit 8 0)
+ (if ew-permit-sticked-comment 16 0)
+ (if ew-permit-sticked-special 32 0)
+ (if ew-remove-bare-crlf 64 0)
+ )))