From: yamaoka Date: Wed, 18 Nov 1998 11:11:12 +0000 (+0000) Subject: Sync up with the latest semi-1_11. X-Git-Tag: wemi-199811302358~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=08633154858eb4018689873d8eee3d42aec97251;p=elisp%2Fsemi.git Sync up with the latest semi-1_11. --- diff --git a/ChangeLog b/ChangeLog index 31496d6..7d11d70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +1998-11-18 Keiichi Suzuki + + * mime-edit.el (mime-content-transfer-encoding-priority-list): New + variable. + (mime-edit-translate-single-part-tag): Change return value to + `nil' or a cons which include content-type and encoding. + (mime-edit-translate-region): Generate `encodeing' from + return value of `mime-edit-translate-single-part-tag'. + + 1998-11-16 Katsumi Yamaoka * WEMI: Version 1.11.0 (Okitsu) released. diff --git a/mime-edit.el b/mime-edit.el index 6ba9f85..873c5bf 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -4,7 +4,6 @@ ;; Author: UMEDA Masanobu ;; MORIOKA Tomohiko -;; Maintainer: MORIOKA Tomohiko ;; Created: 1994/08/21 renamed from mime.el ;; Renamed: 1997/2/21 from tm-edit.el ;; Keywords: MIME, multimedia, multilingual, mail, news @@ -506,6 +505,11 @@ If encoding is nil, it is determined from its contents." (make-variable-buffer-local 'mime-transfer-level-string) +;;; @@ about content transfer encoding + +(defvar mime-content-transfer-encoding-priority-list + '(nil "8bit" "binary")) + ;;; @@ about message inserting ;;; @@ -1958,8 +1962,12 @@ Content-Transfer-Encoding: 7bit (if encoding (insert "Content-Transfer-Encoding: " encoding "\n")) (eword-encode-header) - )) - t))) + ) + (cons (and contype + (downcase contype)) + (and encoding + (downcase encoding)))) + ))) (defun mime-edit-translate-region (beg end &optional boundary multipart) (or boundary @@ -1995,22 +2003,26 @@ Content-Transfer-Encoding: 7bit (t ;; It's a multipart message. (goto-char (point-min)) - (and (mime-edit-translate-single-part-tag boundary) - (while (mime-edit-translate-single-part-tag boundary "\n"))) - ;; Define Content-Type as "multipart/mixed". - (setq contype - (concat "multipart/mixed;\n boundary=\"" boundary "\"")) - ;; Content-Transfer-Encoding must be "7bit". - ;; The following encoding can be `nil', but is - ;; specified as is since there is no way that a user - ;; specifies it. - (setq encoding "7bit") - ;; Insert the trailer. - (goto-char (point-max)) - (insert "\n--" boundary "--\n") - )) - (list contype encoding boundary nparts) - )))) + (let ((prio mime-content-transfer-encoding-priority-list) + part-info nprio) + (when (setq part-info + (mime-edit-translate-single-part-tag boundary)) + (and (setq nprio (member (cdr part-info) prio)) + (setq prio nprio)) + (while (setq part-info + (mime-edit-translate-single-part-tag boundary "\n")) + (and (setq nprio (member (cdr part-info) prio)) + (setq prio nprio)))) + ;; Define Content-Type as "multipart/mixed". + (setq contype + (concat "multipart/mixed;\n boundary=\"" boundary "\"")) + (setq encoding (car prio)) + ;; Insert the trailer. + (goto-char (point-max)) + (insert "\n--" boundary "--\n") + ))) + (list contype encoding boundary nparts) + )))) (defun mime-edit-normalize-body () "Normalize the body part by inserting appropriate message tags."