From 03a79486f51ecc67472c4dba517a98c36623f61f Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 28 Aug 1998 08:54:48 +0000 Subject: [PATCH] (eword-encode-structured-field-body): New function. (eword-encode-field): Use `eword-encode-structured-field-body' for "MIME-Version" and "User-Agent" field. --- eword-encode.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/eword-encode.el b/eword-encode.el index d90af2d..ff09e94 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -522,13 +522,18 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (tm-eword::addresses-to-rwl (std11-parse-addresses-string string)) ))) +(defun eword-encode-structured-field-body (string &optional column) + (car (tm-eword::encode-rwl + (or column 0) + (eword-addr-seq-to-rwl (std11-lexical-analyze string)) + ))) + ;;; @ application interfaces ;;; (defun eword-encode-string (str &optional column mode) - (car (tm-eword::encode-rwl (or column 0) (tm-eword::split-string str mode))) - ) + (car (tm-eword::encode-rwl (or column 0) (tm-eword::split-string str mode)))) (defun eword-encode-field (string) "Encode header field STRING, and return the result. @@ -540,21 +545,25 @@ encoded-word. ASCII token is not encoded." (let ((field-name (substring string 0 (1- (match-end 0)))) (field-body (eliminate-top-spaces (substring string (match-end 0)))) - ) + field-name-symbol) (if (setq ret - (cond ((string-equal field-body "") "") - ((memq (intern (downcase field-name)) + (cond ((string= field-body "") "") + ((memq (setq field-name-symbol + (intern (downcase field-name))) '(reply-to from sender resent-reply-to resent-from resent-sender to resent-to cc resent-cc - bcc resent-bcc dcc - mime-version) - ) + bcc resent-bcc dcc)) (eword-encode-address-list field-body (+ (length field-name) 2)) ) + ((memq field-name-symbol + '(mime-version user-agent)) + (eword-encode-structured-field-body + field-body (+ (length field-name) 2)) + ) (t (eword-encode-string field-body (1+ (length field-name)) -- 1.7.10.4