-(defconst mime-edit-mime-map (make-sparse-keymap)
- "Keymap for MIME commands.")
-
-(or (keymapp mime-edit-mime-map)
- (progn
- (define-key mime-edit-mime-map "\C-t" 'mime-edit-insert-text)
- (define-key mime-edit-mime-map "\C-i" 'mime-edit-insert-file)
- (define-key mime-edit-mime-map "\C-e" 'mime-edit-insert-external)
- (define-key mime-edit-mime-map "\C-v" 'mime-edit-insert-voice)
- (define-key mime-edit-mime-map "\C-y" 'mime-edit-insert-message)
- (define-key mime-edit-mime-map "\C-m" 'mime-edit-insert-mail)
- (define-key mime-edit-mime-map "\C-w" 'mime-edit-insert-signature)
- (define-key mime-edit-mime-map "\C-s" 'mime-edit-insert-signature)
- (define-key mime-edit-mime-map "\C-k" 'mime-edit-insert-key)
- (define-key mime-edit-mime-map "t" 'mime-edit-insert-tag)
- (define-key mime-edit-mime-map
- "a" 'mime-edit-enclose-alternative-region)
- (define-key mime-edit-mime-map "p" 'mime-edit-enclose-parallel-region)
- (define-key mime-edit-mime-map "m" 'mime-edit-enclose-mixed-region)
- (define-key mime-edit-mime-map "d" 'mime-edit-enclose-digest-region)
- (define-key mime-edit-mime-map "s" 'mime-edit-enclose-signed-region)
- (define-key mime-edit-mime-map
- "e" 'mime-edit-enclose-encrypted-region)
- (define-key mime-edit-mime-map "q" 'mime-edit-enclose-quote-region)
- (define-key mime-edit-mime-map "7" 'mime-edit-set-transfer-level-7bit)
- (define-key mime-edit-mime-map "8" 'mime-edit-set-transfer-level-8bit)
- (define-key mime-edit-mime-map "/" 'mime-edit-set-split)
- (define-key mime-edit-mime-map "v" 'mime-edit-set-sign)
- (define-key mime-edit-mime-map "h" 'mime-edit-set-encrypt)
- (define-key mime-edit-mime-map "\C-p" 'mime-edit-preview-message)
- (define-key mime-edit-mime-map "\C-z" 'mime-edit-exit)
- (define-key mime-edit-mime-map "?" 'mime-edit-help)
- ))
-
-(defun mime-edit-toggle-mode ()
- (interactive)
- (if mime-edit-mode-flag
- (mime-edit-exit 'nomime)
- (mime-edit-mode)
- ))
-
-(cond (running-xemacs
- (defconst mime-edit-minor-mime-map nil "Keymap for MIME commands.")
- (or mime-edit-minor-mime-map
- (progn
- (setq mime-edit-minor-mime-map
- (make-sparse-keymap 'mime-edit-minor-mime-map))
- (define-key
- mime-edit-minor-mime-map mime-edit-prefix mime-edit-mime-map)
- ))
- (add-minor-mode 'mime-edit-mode-flag
- '((" MIME-Edit " mime-transfer-level-string))
- mime-edit-minor-mime-map
- nil
- 'mime-edit-toggle-mode)
- )
- (t
- (set-alist 'minor-mode-alist
- 'mime-edit-mode-flag
- '((" MIME-Edit " mime-transfer-level-string))))
- )
+(defvar mime-edit-mode-entity-prefix "\C-c\C-x"
+ "Keymap prefix for MIME-Edit mode commands to insert entity or set status.")
+(defvar mime-edit-mode-entity-map (make-sparse-keymap)
+ "Keymap for MIME-Edit mode commands to insert entity or set status.")
+
+(define-key mime-edit-mode-entity-map "\C-t" 'mime-edit-insert-text)
+(define-key mime-edit-mode-entity-map "\C-i" 'mime-edit-insert-file)
+(define-key mime-edit-mode-entity-map "\C-e" 'mime-edit-insert-external)
+(define-key mime-edit-mode-entity-map "\C-v" 'mime-edit-insert-voice)
+(define-key mime-edit-mode-entity-map "\C-y" 'mime-edit-insert-message)
+(define-key mime-edit-mode-entity-map "\C-m" 'mime-edit-insert-mail)
+(define-key mime-edit-mode-entity-map "\C-w" 'mime-edit-insert-signature)
+(define-key mime-edit-mode-entity-map "\C-s" 'mime-edit-insert-signature)
+(define-key mime-edit-mode-entity-map "\C-k" 'mime-edit-insert-key)
+(define-key mime-edit-mode-entity-map "t" 'mime-edit-insert-tag)
+
+(define-key mime-edit-mode-entity-map "7" 'mime-edit-set-transfer-level-7bit)
+(define-key mime-edit-mode-entity-map "8" 'mime-edit-set-transfer-level-8bit)
+(define-key mime-edit-mode-entity-map "/" 'mime-edit-set-split)
+(define-key mime-edit-mode-entity-map "s" 'mime-edit-set-sign)
+(define-key mime-edit-mode-entity-map "v" 'mime-edit-set-sign)
+(define-key mime-edit-mode-entity-map "e" 'mime-edit-set-encrypt)
+(define-key mime-edit-mode-entity-map "h" 'mime-edit-set-encrypt)
+(define-key mime-edit-mode-entity-map "p" 'mime-edit-preview-message)
+(define-key mime-edit-mode-entity-map "\C-z" 'mime-edit-exit)
+(define-key mime-edit-mode-entity-map "?" 'mime-edit-help)
+
+(defvar mime-edit-mode-enclosure-prefix "\C-c\C-m"
+ "Keymap prefix for MIME-Edit mode commands about enclosure.")
+(defvar mime-edit-mode-enclosure-map (make-sparse-keymap)
+ "Keymap for MIME-Edit mode commands about enclosure.")
+
+(define-key mime-edit-mode-enclosure-map
+ "\C-a" 'mime-edit-enclose-alternative-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-p" 'mime-edit-enclose-parallel-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-m" 'mime-edit-enclose-mixed-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-d" 'mime-edit-enclose-digest-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-s" 'mime-edit-enclose-signed-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-e" 'mime-edit-enclose-encrypted-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-q" 'mime-edit-enclose-quote-region)
+
+(defvar mime-edit-mode-map (make-sparse-keymap)
+ "Keymap for MIME-Edit mode commands.")
+(define-key mime-edit-mode-map
+ mime-edit-mode-entity-prefix mime-edit-mode-entity-map)
+(define-key mime-edit-mode-map
+ mime-edit-mode-enclosure-prefix mime-edit-mode-enclosure-map)