(message "gnus-unstructured-field-decoder error: %s" string)
(decode-mime-charset-string string 'x-ctext))))
(eword-decode-unstructured-field-body (std11-unfold-string string) 'must-unfold)))
-
-(defun ew-mime-update-field-decoder-cache (field mode)
- (let ((fun (cond
- ((eq mode 'plain)
- (lexical-let ((field-name (symbol-name field)))
- (lambda (field-body &optional start-column max-column must-unfold)
- (setq field-body (ew-lf-to-crlf field-body))
- (let ((res (ew-crlf-to-lf
- (ew-decode-field field-name field-body))))
- (add-text-properties
- 0 (length res)
- (list 'original-field-name field-name
- 'original-field-body field-body)
- res)
- res))))
- ((eq mode 'wide)
- (lexical-let ((field-name (symbol-name field)))
- (lambda (field-body &optional start-column max-column must-unfold)
- (setq field-body (ew-lf-to-crlf field-body))
- (let ((res (ew-crlf-to-lf
- (ew-crlf-refold
- (ew-decode-field field-name field-body)
- (length field-name)
- (or max-column fill-column)))))
- (add-text-properties
- 0 (length res)
- (list 'original-field-name field-name
- 'original-field-body field-body)
- res)
- res))))
- ((eq mode 'summary)
- (lexical-let ((field-name (symbol-name field)))
- (lambda (field-body &optional start-column max-column must-unfold)
- (setq field-body (ew-lf-to-crlf field-body))
- (let ((res (ew-crlf-to-lf
- (ew-crlf-unfold
- (ew-decode-field field-name field-body)))))
- (add-text-properties
- 0 (length res)
- (list 'original-field-name field-name
- 'original-field-body field-body)
- res)
- res))))
- ((eq mode 'nov)
- (lexical-let ((field-name (symbol-name field)))
- (lambda (field-body &optional start-column max-column must-unfold)
- (setq field-body (ew-lf-to-crlf field-body))
- (require 'ew-var)
- (let ((ew-ignore-76bytes-limit t))
- (let ((res (ew-crlf-to-lf
- (ew-crlf-unfold
- (ew-decode-field field-name field-body)))))
- (add-text-properties
- 0 (length res)
- (list 'original-field-name field-name
- 'original-field-body field-body)
- res)
- res)))))
- (t
- nil))))
- (mime-update-field-decoder-cache field mode fun)))
-
-(setq mime-update-field-decoder-cache 'ew-mime-update-field-decoder-cache)