* mime-edit.el (mime-edit-insert-file): Ask user for MIME type and
subtype during interactive file insertion, not only encoding.
+ * mime-pgp.el (toplevel): New function:
+ `mime-display-multipart/pgp-encrypted'.
+ * pgg-def.el (toplevel): New custom: `pgg-decrypt-automatically'.
+ * semi-setup.el (toplevel): New mime-preview condtion for MIME
+ type "application/pgp-encrypted".
2010-01-19 Vitaly Mayatskikh <v.mayatskih@gmail.com>
(setq mime-view-temp-message-buffer message-buf))
(set-window-buffer p-win preview-buffer))))
+(defun mime-display-multipart/pgp-encrypted (entity situation)
+ (if pgg-decrypt-automatically
+ (let ((pgp-begin (point)))
+ (mime-insert-entity entity)
+ (goto-char pgp-begin)
+ (when (re-search-forward "^-+BEGIN PGP MESSAGE-+$" nil t)
+ (pgg-decrypt-region pgp-begin (point-max))
+ (delete-region pgp-begin (point-max))
+ (mime-display-entity
+ (mime-parse-buffer pgg-output-buffer))))
+ (mime-display-multipart/mixed entity situation)))
;;; @ end
;;;
:group 'pgg
:type 'boolean)
+(defcustom pgg-decrypt-automatically nil
+ "*If t, decrypt messages automatically."
+ :group 'pgg
+ :type 'boolean)
+
(defvar pgg-messages-coding-system nil
"Coding system used when reading from a PGP external process.")
(if mime-setup-enable-pgp
(eval-after-load "mime-view"
'(progn
+ (require 'mime-pgp)
+
(mime-add-condition
'preview '((type . application)(subtype . pgp)
(message-button . visible)))
'((type . application)(subtype . x-pkcs7-mime)
(method . mime-view-application/pkcs7-mime))
'strict "mime-pgp")
+
+ (ctree-set-calist-strictly
+ 'mime-preview-condition
+ '((type . multipart) (subtype . encrypted) ("protocol" . "application/pgp-encrypted")
+ (body . visible)
+ (body-presentation-method . mime-display-multipart/pgp-encrypted)))
))
)