- (let* ((ew-decode-field-default-syntax '(ew-scan-unibyte-std11))
- (decoded (ew-decode-field (make-string (1- start-column) ?X)
- (ew-lf-crlf-to-crlf string)
- (if must-unfold 'ew-cut-cr-lf)))
- column)
- (setq decoded (ew-crlf-to-lf decoded))
- (setq column 0)
- (ew-lf-line-convert decoded
- (lambda (line)
- (if (<= (length line) max-column)
- line
- (let ((start 0) index)
- (catch 'loop
- (while (< (+ column start) max-column)
- (if (string-match " " decoded start)
- (progn
- (setq start (match-end 0))
- (when (< (match-beginning 0) max-column)
- (setq index (match-beginning 0))))
- (throw 'loop nil)))
- (setq index (string-match " " decoded start)))
- (if index
- (concat (substring decoded 0 index)
- "\n"
- (substring decoded index))
- decoded))))
- (lambda (str) (setq column 1) str)
- (lambda (str) (setq column 0) str))))
+ (let* ((field-name (make-string (1- start-column) ?X))
+ (field-body (ew-lf-crlf-to-crlf string))
+ (ew-decode-field-default-syntax '(ew-scan-unibyte-std11))
+ (decoded (ew-decode-field field-name field-body)))
+ (unless (equal field-body decoded)
+ (setq decoded (ew-crlf-refold decoded start-column max-column)))
+ (ew-crlf-to-lf decoded)))