;; 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.87 $
+;; Version: $Revision: 0.92 $
;; 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.87 1997-09-03 04:53:10 morioka Exp $")
+ "$Id: mime-edit.el,v 0.92 1997-10-02 07:48:02 morioka Exp $")
(defconst mime-edit-version `,(get-version-string mime-edit-RCS-ID))
(defconst mime-edit-version-name
`,(concat "SEMI MIME-Edit " mime-edit-version
- " \"" semi-version-name "\""))
+ " - \"" semi-version-name "\""))
;;; @ variables
"*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"))
+ (if (featurep '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))))
+ (concat "Emacs " ver ", MULE " mule-version
+ (if (featurep 'meadow)
+ (concat ", " (Meadow-version))
+ ))
+ ver)))
+ "Body of X-Emacs field.
+If variable `mime-edit-insert-x-emacs-field' is not nil, it is
+inserted into message header.")
\f
;;; @ constants
(concat "1.0 (generated by " mime-edit-version-name ")")
"MIME version number.")
+(defconst mime-edit-mime-version-field-for-message/partial
+ (concat "MIME-Version: 1.0 (split by " mime-edit-version-name ")\n")
+ "MIME version field for message/partial.")
+
;;; @ keymap and menu
;;;
(insert "\n")
(forward-char -1)
))
- (if (and (member (second ret) '("enriched" "richtext"))
+ (if (and (member (cadr ret) '("enriched" "richtext"))
(fboundp 'enriched-mode)
)
(enriched-mode t)
(insert mime-edit-x-emacs-value)
))
;; Make primary MIME headers.
- (or (mail-position-on-field "Mime-Version")
+ (or (mail-position-on-field "MIME-Version")
(insert mime-edit-mime-version-value))
;; Remove old Content-Type and other fields.
(save-restriction
;;; @ split
;;;
-(defun mime-edit-insert-partial-header
- (fields subject id number total separator)
+(defun mime-edit-insert-partial-header (fields subject
+ id number total separator)
(insert fields)
(insert (format "Subject: %s (%d/%d)\n" subject number total))
- (insert (format "Mime-Version: 1.0 (split by %s)\n"
- mime-edit-version-name))
+ (insert mime-edit-mime-version-field-for-message/partial)
(insert (format "\
Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
id number total separator))
(goto-char (point-min))
(let ((ctl (mime-read-Content-Type)))
(if ctl
- (let ((ctype (car ctl))
- (params (cdr ctl))
- type stype)
- (if (string-match "/" ctype)
- (progn
- (setq type (substring ctype 0 (match-beginning 0)))
- (setq stype (substring ctype (match-end 0)))
- )
- (setq type ctype)
- )
+ (let ((type (car ctl))
+ (stype (car (cdr ctl)))
+ (params (cdr (cdr ctl)))
+ )
(cond
- ((string= ctype "application/pgp-signature")
+ ((and (eq type 'application)(eq stype 'pgp-signature))
(delete-region (point-min)(point-max))
)
- ((string= type "multipart")
+ ((eq type 'multipart)
(let* ((boundary (cdr (assoc "boundary" params)))
(boundary-pat
(concat "\n--" (regexp-quote boundary) "[ \t]*\n"))
)))
))
(t
- (let* (charset
+ (let* ((ctype (format "%s/%s" type stype))
+ charset
(pstr
(let ((bytes (+ 14 (length ctype))))
(mapconcat (function
(lambda (attr)
- (if (string-equal (car attr) "charset")
+ (if (string= (car attr) "charset")
(progn
(setq charset (cdr attr))
"")
(eliminate-top-spaces
(std11-unfold-string
(buffer-substring hbeg end))))
- (if (or charset (string-equal type "text"))
+ (if (or charset (eq type 'text))
(progn
(delete-region beg (1+ end))
(goto-char (point-min))
(insert
(concat "\n"
(mime-create-tag
- (concat type "/" stype pstr) encoding)))
+ (format "%s/%s%s" type stype pstr)
+ encoding)))
)
(delete-region (point-min) he)
(insert
(mime-create-tag
- (concat type "/" stype pstr) encoding))
+ (format "%s/%s%s" type stype pstr)
+ encoding))
))
))))
(or not-decode-text