Delete mmgeneric.el.
[elisp/flim.git] / ew-compat.el
1 (require 'ew-dec)
2 (require 'eword-decode)
3
4 (require 'ew-line)
5 (eval-when-compile (require 'cl))
6
7 (defun ew-gnus-structured-field-decoder (string)
8   (if (fboundp 'ew-decode-field)
9       (let ((ew-ignore-76bytes-limit t)
10             (ew-default-mime-charset default-mime-charset))
11         (condition-case nil
12             (ew-cut-cr-lf (ew-decode-field "From" (ew-lf-crlf-to-crlf string)))
13           (error
14            (message "gnus-structured-field-decoder error: %s" string)
15            (decode-mime-charset-string string 'x-ctext))))
16     (eword-decode-and-unfold-structured-field-body string)))
17
18 (defun ew-gnus-unstructured-field-decoder (string)
19   (if (fboundp 'ew-decode-field)
20       (let ((ew-ignore-76bytes-limit t)
21             (ew-default-mime-charset default-mime-charset))
22         (condition-case nil
23             (ew-cut-cr-lf (ew-decode-field "Subject" (ew-lf-crlf-to-crlf string)))
24           (error
25            (message "gnus-unstructured-field-decoder error: %s" string)
26            (decode-mime-charset-string string 'x-ctext))))
27     (eword-decode-unstructured-field-body (std11-unfold-string string) 'must-unfold)))