From: morioka Date: Fri, 28 Aug 1998 08:54:48 +0000 (+0000) Subject: (eword-encode-structured-field-body): New function. X-Git-Tag: flim-1_9_1~27 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=03a79486f51ecc67472c4dba517a98c36623f61f;p=elisp%2Fflim.git (eword-encode-structured-field-body): New function. (eword-encode-field): Use `eword-encode-structured-field-body' for "MIME-Version" and "User-Agent" field. --- 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))