;; 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.66 $
+;; Version: $Revision: 0.67 $
;; Keywords: MIME, multimedia, multilingual, mail, news
;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
;; News mode. First of all, you need the following autoload
;; definition to load mime-edit-mode automatically:
;;
-;; (autoload 'mime-edit-mode "mime-edit"
+;; (autoload 'turn-on-mime-edit "mime-edit"
;; "Minor mode for editing MIME message." t)
;;
;; In case of Mail mode (includes VM mode), you need the following
;; hook definition:
;;
-;; (add-hook 'mail-mode-hook 'mime-edit-mode)
+;; (add-hook 'mail-mode-hook 'turn-on-mime-edit)
;; (add-hook 'mail-send-hook 'mime-edit-maybe-translate)
;;
;; In case of MH-E, you need the following hook definition:
;; (add-hook 'mh-letter-mode-hook
;; (function
;; (lambda ()
-;; (mime-edit-mode)
+;; (turn-on-mime-edit)
;; (make-local-variable 'mail-header-separator)
;; (setq mail-header-separator "--------")
;; ))))
;;
;; In case of News mode, you need the following hook definition:
;;
-;; (add-hook 'news-reply-mode-hook 'mime-edit-mode)
+;; (add-hook 'news-reply-mode-hook 'turn-on-mime-edit)
;; (add-hook 'news-inews-hook 'mime-edit-maybe-translate)
;;
;; In case of Emacs 19, it is possible to emphasize the message tags
;;;
(defconst mime-edit-RCS-ID
- "$Id: mime-edit.el,v 0.66 1997-03-06 20:46:31 morioka Exp $")
+ "$Id: mime-edit.el,v 0.67 1997-03-07 13:11:57 morioka Exp $")
(defconst mime-edit-version (get-version-string mime-edit-RCS-ID))
)
))
-(defun mime-edit-toggle-mode ()
- (interactive)
- (if mime-edit-mode-flag
- (mime-edit-exit 'nomime)
- (mime-edit-mode)
- ))
-
(cond (running-xemacs
(add-minor-mode 'mime-edit-mode-flag
'((" MIME-Edit " mime-transfer-level-string))
mime-edit-mode-map
nil
- 'mime-edit-toggle-mode)
+ 'mime-edit-mode)
)
(t
(set-alist 'minor-mode-alist
non-nil."
(interactive)
(if mime-edit-mode-flag
+ (mime-edit-exit)
+ (if (and (boundp 'mime-edit-touched-flag)
+ mime-edit-touched-flag)
+ (mime-edit-again)
+ (make-local-variable 'mime-edit-touched-flag)
+ (setq mime-edit-touched-flag t)
+ (turn-on-mime-edit)
+ )))
+
+;;;###autoload
+(defun turn-on-mime-edit ()
+ "Unconditionally turn on MIME-Edit mode."
+ (interactive)
+ (if mime-edit-mode-flag
(error "You are already editing a MIME message.")
(setq mime-edit-mode-flag t)
(mime-encoding-name mime-transfer-level 'not-omit))
(force-mode-line-update)
- ;; Define menu. Menus for other emacs implementations are
- ;; welcome.
- (cond (running-xemacs
- (mime-edit-define-menu-for-xemacs))
- ;; ((>= emacs-major-version 19)
- ;; (mime-edit-define-menu-for-emacs19)
- ;; )
- )
- ;; end
+ ;; Define menu for XEmacs.
+ (if running-xemacs
+ (mime-edit-define-menu-for-xemacs)
+ )
(enable-invisible)
))
;;;###autoload
-(defalias 'edit-mime 'mime-edit-mode) ; for convenience
-(defalias 'mime-mode 'mime-edit-mode) ; for convenience
+(defalias 'edit-mime 'turn-on-mime-edit) ; for convenience
(defun mime-edit-exit (&optional nomime no-error)
"Translate the tagged MIME message into a MIME compliant message.
(replace-match mail-header-separator)
))
(or no-mode
- (mime-edit-mode)
+ (turn-on-mime-edit)
))