From: yamaoka Date: Sun, 14 Apr 2002 22:12:09 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_6-02-quimby~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d880e11a55689fb0998fd9f7530484507280ecb0;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b0de31..33bed24 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2002-04-13 Josh Huber + + * mml-sec.el (mml-secure-message): changed to support arbritrary + modes. + * mml-sec.el (mml-secure-message-encrypt-(smime|pgp|pgpmime)): + changed to support "signencrypt" mode. + * mml.el (mml-parse-1): changed to support different secure modes + more easily. (for signencrypt) + 2002-04-11 Stefan Monnier * gnus-sum.el (gnus-update-summary-mark-positions) diff --git a/lisp/mml-sec.el b/lisp/mml-sec.el index a347cc3..09fec43 100644 --- a/lisp/mml-sec.el +++ b/lisp/mml-sec.el @@ -128,8 +128,8 @@ (mml-secure-part "smime")) ;; defuns that add the proper <#secure ...> tag to the top of the message body -(defun mml-secure-message (method &optional sign) - (let ((mode (if sign "sign" "encrypt")) +(defun mml-secure-message (method &optional modesym) + (let ((mode (prin1-to-string modesym)) insert-loc) (mml-unsecure-message) (save-excursion @@ -168,20 +168,27 @@ (interactive) (mml-secure-message "pgpmime" 'sign)) -(defun mml-secure-message-encrypt-smime () - "Add MML tag to encrypt/sign the entire message." - (interactive) - (mml-secure-message "smime")) - -(defun mml-secure-message-encrypt-pgp () - "Add MML tag to encrypt/sign the entire message." - (interactive) - (mml-secure-message "pgp")) - -(defun mml-secure-message-encrypt-pgpmime () - "Add MML tag to encrypt/sign the entire message." - (interactive) - (mml-secure-message "pgpmime")) +(defun mml-secure-message-encrypt-smime (&optional dontsign) + "Add MML tag to encrypt and sign the entire message. +If called with a prefix argument, only encrypt (do NOT sign)." + (interactive "P") + (mml-secure-message "smime" (if dontsign 'encrypt 'signencrypt))) + +;;; NOTE: this should be switched to use signencrypt +;;; once it does something sensible +(defun mml-secure-message-encrypt-pgp (&optional dontsign) + "Add MML tag to encrypt and sign the entire message. +If called with a prefix argument, only encrypt (do NOT sign)." + (interactive "P") + (mml-secure-message "pgp" (if dontsign 'encrypt 'encrypt))) + +;;; NOTE: this should be switched to use signencrypt +;;; once it does something sensible +(defun mml-secure-message-encrypt-pgpmime (&optional dontsign) + "Add MML tag to encrypt and sign the entire message. +If called with a prefix argument, only encrypt (do NOT sign)." + (interactive "P") + (mml-secure-message "pgpmime" (if dontsign 'encrypt 'encrypt))) (provide 'mml-sec) diff --git a/lisp/mml.el b/lisp/mml.el index 576871c..4eb71c2 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -151,7 +151,10 @@ one charsets.") (let* (secure-mode (taginfo (mml-read-tag)) (recipients (cdr (assq 'recipients taginfo))) - (location (cdr (assq 'tag-location taginfo)))) + (location (cdr (assq 'tag-location taginfo))) + (mode (cdr (assq 'mode taginfo))) + (method (cdr (assq 'method taginfo))) + tags) (save-excursion (if (re-search-forward @@ -162,11 +165,16 @@ one charsets.") (goto-char location) (re-search-forward "<#secure[^\n]*>\n")) (delete-region (match-beginning 0) (match-end 0)) - (mml-insert-tag secure-mode - (cdr (assq 'mode taginfo)) - (cdr (assq 'method taginfo)) - (and recipients 'recipients) - recipients) + (cond ((string= mode "sign") + (setq tags (list "sign" method))) + ((string= mode "encrypt") + (setq tags (list "encrypt" method))) + ((string= mode "signencrypt") + (setq tags (list "sign" method "encrypt" method)))) + (eval `(mml-insert-tag ,secure-mode + ,@tags + ,(if recipients 'recipients) + ,recipients)) ;; restart the parse (goto-char location))) ((looking-at "<#multipart")