;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1994/08/21 renamed from mime.el
-;;; Version: $Revision: 7.69 $
+;;; Version: $Revision: 7.70 $
;;; Keywords: mail, news, MIME, multimedia, multilingual
;;;
;;; This file is part of tm (Tools for MIME).
;;;
(defconst mime-editor/RCS-ID
- "$Id: tm-edit.el,v 7.69 1996/06/27 14:22:59 morioka Exp $")
+ "$Id: tm-edit.el,v 7.70 1996/07/09 13:30:32 morioka Exp $")
(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
(defconst mime-editor/mime-map (make-sparse-keymap)
"Keymap for MIME commands.")
+(defconst mime-editor/minor-mime-map nil
+ "Keymap for MIME commands.")
;;; @ keymap and menu
;;;
(defvar mime/editor-mode-flag nil)
(make-variable-buffer-local 'mime/editor-mode-flag)
-(set-alist 'minor-mode-alist
- 'mime/editor-mode-flag
- '((" MIME-Edit " mime-editor/transfer-level-string)))
-
(defun mime-editor/define-keymap (keymap)
"Add mime-editor commands to KEYMAP."
(if (not (keymapp keymap))
(mime-editor/define-keymap mime-editor/mime-map)
+(if mime-editor/minor-mime-map
+ ()
+ (setq mime-editor/minor-mime-map
+ (make-sparse-keymap 'mime-editor/minor-mime-map))
+ (define-key mime-editor/minor-mime-map mime-prefix mime-editor/mime-map))
+
+(defun mime-editor/toggle-mode ()
+ (interactive)
+ (if mime/editor-mode-flag
+ (mime-editor/exit 'nomime)
+ (mime/editor-mode)
+ ))
+
+(if running-xemacs
+ (add-minor-mode 'mime/editor-mode-flag
+ '((" MIME-Edit " mime-editor/transfer-level-string))
+ mime-editor/minor-mime-map
+ nil
+ 'mime-editor/toggle-mode)
+ (set-alist 'minor-mode-alist
+ 'mime/editor-mode-flag
+ '((" MIME-Edit " mime-editor/transfer-level-string))))
+
(defconst mime-editor/menu-title "MIME-Edit")
(defconst mime-editor/menu-list
;; Restore previous state.
(setq mime/editor-mode-flag nil)
(cond (running-xemacs
- ;; mime-prefix only defined if binding was nil
- (if (eq (lookup-key (current-local-map) mime-prefix)
- mime-editor/mime-map)
- (define-key (current-local-map) mime-prefix nil))
(delete-menu-item (list mime-editor/menu-title)))
(t
(use-local-map mime/editor-mode-old-local-map)))
;;; modified by Steven L. Baur <steve@miranova.com>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el)
-;;; Version: $Revision: 7.65 $
+;;; Version: $Revision: 7.66 $
;;; Keywords: mail, news, MIME, multimedia
;;;
;;; This file is part of tm (Tools for MIME).
;;;
(defconst mime-viewer/RCS-ID
- "$Id: tm-view.el,v 7.65 1996/05/23 16:45:10 shuhei-k Exp $")
+ "$Id: tm-view.el,v 7.66 1996/07/01 23:42:12 morioka Exp $")
(defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
(defconst mime/viewer-version mime-viewer/version)
)
"Menu for MIME Viewer")
-(defvar mime/viewer-mode-map nil)
-(if (null mime/viewer-mode-map)
+(if running-xemacs
(progn
- (setq mime/viewer-mode-map (make-keymap))
- (suppress-keymap mime/viewer-mode-map)
- (define-key mime/viewer-mode-map
- "u" (function mime-viewer/up-content))
- (define-key mime/viewer-mode-map
- "p" (function mime-viewer/previous-content))
- (define-key mime/viewer-mode-map
- "n" (function mime-viewer/next-content))
- (define-key mime/viewer-mode-map
- " " (function mime-viewer/scroll-up-content))
- (define-key mime/viewer-mode-map
- "\M- " (function mime-viewer/scroll-down-content))
- (define-key mime/viewer-mode-map
- "\177" (function mime-viewer/scroll-down-content))
- (define-key mime/viewer-mode-map
- "\C-m" (function mime-viewer/next-line-content))
- (define-key mime/viewer-mode-map
- "\C-\M-m" (function mime-viewer/previous-line-content))
- (define-key mime/viewer-mode-map
- "v" (function mime-viewer/play-content))
- (define-key mime/viewer-mode-map
- "e" (function mime-viewer/extract-content))
- (define-key mime/viewer-mode-map
- "\C-c\C-p" (function mime-viewer/print-content))
- (define-key mime/viewer-mode-map
- "x" (function mime-viewer/display-x-face))
- (define-key mime/viewer-mode-map
- "a" (function mime-viewer/follow-content))
- (define-key mime/viewer-mode-map
- "q" (function mime-viewer/quit))
- (define-key mime/viewer-mode-map
- "h" (function mime-viewer/show-summary))
- (define-key mime/viewer-mode-map
- "\C-c\C-x" (function mime-viewer/kill-buffer))
- (define-key mime/viewer-mode-map
- "<" (function beginning-of-buffer))
- (define-key mime/viewer-mode-map
- ">" (function end-of-buffer))
- (define-key mime/viewer-mode-map
- "?" (function describe-mode))
- (if mouse-button-2
- (define-key mime/viewer-mode-map
- mouse-button-2 (function tm:button-dispatcher))
- )
- (cond (running-xemacs
- (defvar mime-viewer/xemacs-popup-menu
- (cons mime-viewer/menu-title
- (mapcar (function
- (lambda (item)
- (vector (nth 1 item)(nth 2 item) t)
- ))
- mime-viewer/menu-list)))
- (defun mime-viewer/xemacs-popup-menu (event)
- "Popup the menu in the MIME Viewer buffer"
- (interactive "e")
- (select-window (event-window event))
- (set-buffer (event-buffer event))
- (popup-menu 'mime-viewer/xemacs-popup-menu))
- (define-key mime/viewer-mode-map
- mouse-button-3 (function mime-viewer/xemacs-popup-menu))
- )
- ((>= emacs-major-version 19)
- (define-key mime/viewer-mode-map [menu-bar mime-view]
- (cons mime-viewer/menu-title
- (make-sparse-keymap mime-viewer/menu-title)))
- (mapcar (function
- (lambda (item)
- (define-key mime/viewer-mode-map
- (vector 'menu-bar 'mime-view (car item))
- (cons (nth 1 item)(nth 2 item))
- )
- ))
- (reverse mime-viewer/menu-list)
- )
- ))
+ (defvar mime-viewer/xemacs-popup-menu
+ (cons mime-viewer/menu-title
+ (mapcar (function
+ (lambda (item)
+ (vector (nth 1 item)(nth 2 item) t)
+ ))
+ mime-viewer/menu-list)))
+ (defun mime-viewer/xemacs-popup-menu (event)
+ "Popup the menu in the MIME Viewer buffer"
+ (interactive "e")
+ (select-window (event-window event))
+ (set-buffer (event-buffer event))
+ (popup-menu 'mime-viewer/xemacs-popup-menu))
))
-(defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf)
+(defun mime-viewer/define-keymap (&optional mother)
+ (let ((mime/viewer-mode-map (if mother
+ (copy-keymap mother)
+ (make-keymap))))
+ (suppress-keymap mime/viewer-mode-map)
+ (define-key mime/viewer-mode-map
+ "u" (function mime-viewer/up-content))
+ (define-key mime/viewer-mode-map
+ "p" (function mime-viewer/previous-content))
+ (define-key mime/viewer-mode-map
+ "n" (function mime-viewer/next-content))
+ (define-key mime/viewer-mode-map
+ " " (function mime-viewer/scroll-up-content))
+ (define-key mime/viewer-mode-map
+ "\M- " (function mime-viewer/scroll-down-content))
+ (define-key mime/viewer-mode-map
+ "\177" (function mime-viewer/scroll-down-content))
+ (define-key mime/viewer-mode-map
+ "\C-m" (function mime-viewer/next-line-content))
+ (define-key mime/viewer-mode-map
+ "\C-\M-m" (function mime-viewer/previous-line-content))
+ (define-key mime/viewer-mode-map
+ "v" (function mime-viewer/play-content))
+ (define-key mime/viewer-mode-map
+ "e" (function mime-viewer/extract-content))
+ (define-key mime/viewer-mode-map
+ "\C-c\C-p" (function mime-viewer/print-content))
+ (define-key mime/viewer-mode-map
+ "x" (function mime-viewer/display-x-face))
+ (define-key mime/viewer-mode-map
+ "a" (function mime-viewer/follow-content))
+ (define-key mime/viewer-mode-map
+ "q" (function mime-viewer/quit))
+ (define-key mime/viewer-mode-map
+ "h" (function mime-viewer/show-summary))
+ (define-key mime/viewer-mode-map
+ "\C-c\C-x" (function mime-viewer/kill-buffer))
+ (define-key mime/viewer-mode-map
+ "<" (function beginning-of-buffer))
+ (define-key mime/viewer-mode-map
+ ">" (function end-of-buffer))
+ (define-key mime/viewer-mode-map
+ "?" (function describe-mode))
+ (if mouse-button-2
+ (define-key mime/viewer-mode-map
+ mouse-button-2 (function tm:button-dispatcher))
+ )
+ (cond (running-xemacs
+ (define-key mime/viewer-mode-map
+ mouse-button-3 (function mime-viewer/xemacs-popup-menu))
+ )
+ ((>= emacs-major-version 19)
+ (define-key mime/viewer-mode-map [menu-bar mime-view]
+ (cons mime-viewer/menu-title
+ (make-sparse-keymap mime-viewer/menu-title)))
+ (mapcar (function
+ (lambda (item)
+ (define-key mime/viewer-mode-map
+ (vector 'menu-bar 'mime-view (car item))
+ (cons (nth 1 item)(nth 2 item))
+ )
+ ))
+ (reverse mime-viewer/menu-list)
+ )
+ ))
+ (use-local-map mime/viewer-mode-map)
+ (run-hooks 'mime-viewer/define-keymap-hook)
+ ))
+
+(defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf
+ mother-keymap)
"Major mode for viewing MIME message.
Here is a list of the standard keys for mime/viewer-mode.
q Quit
button-2 Move to point under the mouse cursor
and decode current content as `play mode'
-
-
-Here are all the commands with their current binding,
-listed in key order:
-
-\\{mime/viewer-mode-map}
"
(interactive)
(let ((buf (get-buffer mime/output-buffer-name)))
(progn
(setq mime::preview/mother-buffer mother)
))
- (use-local-map mime/viewer-mode-map)
+ (mime-viewer/define-keymap mother-keymap)
(setq mime::preview/content-list (nth 1 ret))
(goto-char
(let ((ce (mime::preview-content-info/point-max