;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1994/08/21 renamed from mime.el
;; Renamed: 1997/2/21 from tm-edit.el
-;; Version: $Revision: 0.54 $
+;; Version: $Revision: 0.55 $
;; Keywords: MIME, multimedia, multilingual, mail, news
;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
;;;
(defconst mime-edit-RCS-ID
- "$Id: mime-edit.el,v 0.54 1997-03-03 17:31:19 morioka Exp $")
+ "$Id: mime-edit.el,v 0.55 1997-03-04 12:22:39 morioka Exp $")
(defconst mime-edit-version (get-version-string mime-edit-RCS-ID))
"*Alist of file name, types, parameters, and default encoding.
If encoding is nil, it is determined from its contents.")
+
;;; @@ about charset, encoding and transfer-level
;;;
(mime-make-charset-default-encoding-alist mime-transfer-level))
(make-variable-buffer-local 'mime-edit-charset-default-encoding-alist)
+
;;; @@ about message inserting
;;;
(defvar mime-edit-message-inserter-alist nil)
(defvar mime-edit-mail-inserter-alist nil)
+
;;; @@ about message splitting
;;;
(defvar mime-tag-format-with-encoding "--[[%s][%s]]"
"*Control-string making a MIME tag with encoding.")
+
;;; @@ multipart boundary
;;;
"*Boundary of a multipart message.")
+;;; @@ optional header fields
+;;;
+
+(defvar mime-edit-insert-x-emacs-field t
+ "*If non-nil, insert X-Emacs header field.")
+
+(defvar mime-edit-x-emacs-value
+ (if running-xemacs
+ (concat emacs-version
+ (if (featurep 'mule)
+ " with mule"
+ " without mule"))
+ (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
+ (substring emacs-version 0 (match-beginning 0))
+ emacs-version)))
+ (if (featurep 'mule)
+ (concat "Emacs " ver ", MULE " mule-version)
+ ver))))
+
+
;;; @@ buffer local variables
;;;
(defvar mime-edit-translate-buffer-hook
'(mime-edit-pgp-enclose-buffer
- mime-edit-translate-header
- mime-edit-translate-body))
+ mime-edit-translate-body
+ mime-edit-translate-header))
(defun mime-edit-translate-header ()
"Encode the message header into network representation."
(let ((contype (car ret)) ;Content-Type
(encoding (nth 1 ret)) ;Content-Transfer-Encoding
)
+ ;; Insert X-Emacs field
+ (and mime-edit-insert-x-emacs-field
+ (or (mail-position-on-field "X-Emacs")
+ (insert mime-edit-x-emacs-value)
+ ))
;; Make primary MIME headers.
(or (mail-position-on-field "Mime-Version")
(insert mime-edit-mime-version-value))