+ (eval-after-load "mime-view"
+ '(progn
+ (mime-add-condition
+ 'preview '((type . application)(subtype . pgp)
+ (message-button . visible)))
+ (mime-add-condition
+ 'action '((type . application)(subtype . pgp)
+ (method . mime-view-application/pgp))
+ 'strict "mime-pgp")
+ (mime-add-condition
+ 'action '((type . text)(subtype . x-pgp)
+ (method . mime-view-application/pgp)))
+
+ (mime-add-condition
+ 'action '((type . multipart)(subtype . signed)
+ (method . mime-verify-multipart/signed))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-signature)
+ (method . mime-verify-application/pgp-signature))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-encrypted)
+ (method . mime-decrypt-application/pgp-encrypted))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-keys)
+ (method . mime-add-application/pgp-keys))
+ 'strict "mime-pgp")
+ ))
+ )
+
+(if mime-setup-enable-pgp
+ (autoload 'mime-mc-setversion "mime-mc" nil t)
+ )
+
+
+;;; @ for mime-edit
+;;;
+
+(defun mime-setup-decode-message-header ()
+ (save-excursion
+ (save-restriction
+ (goto-char (point-min))
+ (narrow-to-region
+ (point-min)
+ (if (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "$")
+ nil t)
+ (match-beginning 0)
+ (point-max)
+ ))
+ (mime-decode-header-in-buffer)
+ (set-buffer-modified-p nil)
+ )))
+
+(add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header)
+
+
+;;; @@ variables
+;;;
+
+(defvar mime-setup-use-signature t
+ "If it is not nil, mime-setup sets up to use signature.el.")
+
+(defvar mime-setup-default-signature-key "\C-c\C-s"
+ "*Key to insert signature.")
+
+(defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w"))
+ "Alist of major-mode vs. key to insert signature.")
+
+
+;;; @@ for signature
+;;;
+
+(defun mime-setup-set-signature-key ()
+ (let ((keymap (current-local-map)))
+ (if keymap
+ (let ((key
+ (or (cdr (assq major-mode mime-setup-signature-key-alist))
+ mime-setup-default-signature-key)))
+ (define-key keymap key (function insert-signature))
+ ))))
+
+(when mime-setup-use-signature
+ (autoload 'insert-signature "signature" "Insert signature" t)
+ (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key)
+ ;; (setq message-signature nil)