;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1994/08/21 renamed from mime.el
-;; Version: $Revision: 7.106 $
;; Keywords: mail, news, MIME, multimedia, multilingual
;; This file is part of tm (Tools for MIME).
(require 'mel)
(require 'tl-list)
(require 'tm-view)
-(require 'tm-ew-e)
+(require 'eword-encode)
(require 'signature)
;;; @ version
;;;
-(defconst mime-editor/RCS-ID
- "$Id: tm-edit.el,v 7.106 1997/03/20 07:20:15 morioka Exp $")
-
-(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
+(defconst mime-editor/version "8.0 (Your Song)")
(defconst mime-editor/version-name
(concat "tm-edit " mime-editor/version))
("image"
("gif")
("jpeg")
+ ("png")
("tiff")
("x-pic")
("x-mag")
"text" "richtext" nil
nil
nil nil)
- ("\\.html$"
+ ("\\.\\(html\\|htm\\)$"
"text" "html" nil
nil
nil nil)
"quoted-printable"
"attachment" (("filename" . file))
)
- ("\\.jpg$"
+ ("\\.\\(jpeg\\|jpg\\)$"
"image" "jpeg" nil
"base64"
"inline" (("filename" . file))
"base64"
"inline" (("filename" . file))
)
- ("\\.tiff$"
+ ("\\.png$"
+ "image" "png" nil
+ "base64"
+ "inline" (("filename" . file))
+ )
+ ("\\.\\(tiff\\|tif\\)$"
"image" "tiff" nil
"base64"
"inline" (("filename" . file))
"base64"
"attachment" (("filename" . file))
)
+ ("\\.txt$"
+ "text" "plain" nil
+ nil
+ "attachment" (("filename" . file))
+ )
("\\.el$"
"application" "octet-stream" (("type" . "emacs-lisp"))
- "7bit"
+ nil
"attachment" (("filename" . file))
)
("\\.lsp$"
"base64"
"attachment" (("filename" . file))
)
- ("\\.diff$"
+ ("\\.diffs?$"
"application" "octet-stream" (("type" . "patch"))
nil
"attachment" (("filename" . file))
(defconst mime-editor/menu-list
'((mime-help "Describe MIME editor mode" mime-editor/help)
(file "Insert File" mime-editor/insert-file)
+ (file "Insert File (verbose)" mime-editor/insert-file-verbose)
(external "Insert External" mime-editor/insert-external)
(voice "Insert Voice" mime-editor/insert-voice)
(message "Insert Message" mime-editor/insert-message)
(defun mime-editor/define-menu-for-xemacs ()
"Define menu for Emacs 19."
(cond ((featurep 'menubar)
- (make-local-variable 'current-menubar)
- (set-buffer-menubar current-menubar)
- (add-submenu nil
- (cons mime-editor/menu-title
- (mapcar (function
- (lambda (item)
- (vector (nth 1 item)(nth 2 item)
- mime/editor-mode-flag)
- ))
- mime-editor/menu-list)))
+ ;; (make-local-variable 'current-menubar)
+ ;; (set-buffer-menubar current-menubar)
+ ;; (add-submenu nil
+ ;; (cons mime-editor/menu-title
+ ;; (mapcar (function
+ ;; (lambda (item)
+ ;; (vector (nth 1 item)(nth 2 item)
+ ;; mime/editor-mode-flag)
+ ;; ))
+ ;; mime-editor/menu-list)))
+ (easy-menu-add
+ (cons mime-editor/menu-title
+ (mapcar (function
+ (lambda (item)
+ (vector (nth 1 item)(nth 2 item)
+ mime/editor-mode-flag)
+ ))
+ mime-editor/menu-list)))
)))
;;; modified by Steven L. Baur <steve@miranova.com>
\[make single part\]
\\[mime-editor/insert-text] insert a text message.
\\[mime-editor/insert-file] insert a (binary) file.
+\\[mime-editor/insert-file-verbose] insert a (binary) file, with verbose
+ MIME prompting.
\\[mime-editor/insert-external] insert a reference to external body.
\\[mime-editor/insert-voice] insert a voice message.
\\[mime-editor/insert-message] insert a mail or news message.
(setq type (mime-prompt-for-type type)
subtype (mime-prompt-for-subtype type subtype)
))
- (if (or (interactive-p) verbose)
+ (if (or (interactive-p) verbose (null encoding))
(setq encoding (mime-prompt-for-encoding encoding))
)
(if (or (consp parameters) (stringp disposition-type))
(mime-editor/insert-binary-file file encoding)
))
+;;
+;; mime-editor/insert-file-verbose exists so that users can access verbose
+;; functionality from menu picks, and not just key sequences.
+;;
+(defun mime-editor/insert-file-verbose (file)
+ "Insert a message from a file, with verbose MIME prompting"
+ (interactive "fInsert file as MIME message: \n")
+ (mime-editor/insert-file file t)
+ )
+
(defun mime-editor/insert-external ()
"Insert a reference to external body."
(interactive)
(defun mime-find-file-type (file)
"Guess Content-Type, subtype, and parameters from FILE."
(let ((guess nil)
- (guesses mime-file-types))
+ (guesses mime-file-types)
+ (case-fold-search t))
(while (and (not guess) guesses)
(if (string-match (car (car guesses)) file)
(setq guess (cdr (car guesses))))
(defun mime-editor/translate-header ()
"Encode the message header into network representation."
- (mime/encode-message-header 'code-conversion)
+ (eword-encode-header 'code-conversion)
(run-hooks 'mime-editor/translate-header-hook)
)
(insert (format "Content-Transfer-Encoding: %s\n" encoding))
)
(insert "\n")
- (or (funcall (pgp-function 'mime-sign)
- (point-min)(point-max) nil nil pgp-boundary)
+ (or (as-binary-process
+ (funcall (pgp-function 'mime-sign)
+ (point-min)(point-max) nil nil pgp-boundary))
(throw 'mime-editor/error 'pgp-error)
)
))))
(insert "Content-Type: " contype "\n")
(if encoding
(insert "Content-Transfer-Encoding: " encoding "\n"))
- (mime/encode-message-header)
+ (eword-encode-header)
))
t)))
)
(encode-mime-charset-region beg (mime-editor/content-end)
charset)
- (mime-encode-region beg (mime-editor/content-end) encoding)
+ (if encoding
+ (mime-encode-region beg (mime-editor/content-end) encoding))
(mime-editor/define-encoding encoding)
))
(goto-char (mime-editor/content-end))