* mml2015.el (mml2015-encrypt-to-self): New user option.
authorDaiki Ueno <ueno@unixuser.org>
Fri, 28 Jul 2006 03:35:08 +0000 (03:35 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Fri, 28 Jul 2006 03:35:08 +0000 (03:35 +0000)
(mml2015-epg-encrypt): Append mml2015-signers to recipients list if
mml2015-epg-encrypt is set.

* mml1991.el (mml1991-encrypt-to-self): New variable.
(mml1991-epg-encrypt): Append mml1991-signers to recipients list if
mml1991-epg-encrypt is set.

lisp/ChangeLog
lisp/mml1991.el
lisp/mml2015.el

index 6146140..313a17b 100644 (file)
@@ -1,5 +1,13 @@
 2006-07-28  Daiki Ueno  <ueno@unixuser.org>
 
+       * mml2015.el (mml2015-encrypt-to-self): New user option.
+       (mml2015-epg-encrypt): Append mml2015-signers to recipients list if
+       mml2015-epg-encrypt is set.
+
+       * mml1991.el (mml1991-encrypt-to-self): New variable.
+       (mml1991-epg-encrypt): Append mml1991-signers to recipients list if
+       mml1991-epg-encrypt is set.
+
        * mml2015.el (mml2015-signers): New user option.
        (mml2015-epg-sign): Reflect the value of mml2015-signers.
        (mml2015-epg-encrypt): Allow to select signing keys.
index 44e8c66..e543983 100644 (file)
@@ -65,7 +65,10 @@ Whether the passphrase is cached at all is controlled by
 `mml1991-cache-passphrase'.")
 
 (defvar mml1991-signers nil
-  "A list of key ID which will be used to sign a message.")
+  "A list of your own key ID which will be used to sign a message.")
+
+(defvar mml1991-encrypt-to-self nil
+  "If t, add your own key ID to recipient list when encryption.")
 
 ;;; mailcrypt wrapper
 
@@ -434,6 +437,12 @@ If no one is selected, symmetric encryption will be performed.  "
                    (split-string
                     (message-options-get 'message-recipients)
                     "[ \f\t\n\r\v,]+"))))
+    (if mml1991-encrypt-to-self
+       (setq recipients
+             (nconc recipients
+                    (mapcar (lambda (name)
+                              (car (epg-list-keys context name)))
+                            mml1991-signers))))
     (when sign
       (if mml1991-verbose
          (setq signers (epa-select-keys context "Select keys for signing.
index 54d5f35..b83077b 100644 (file)
@@ -121,10 +121,15 @@ Whether the passphrase is cached at all is controlled by
   :type 'integer)
 
 (defcustom mml2015-signers nil
-  "A list of key ID which will be used to sign a message."
+  "A list of your own key ID which will be used to sign a message."
   :group 'mime-security
   :type '(repeat (string :tag "Key ID")))
 
+(defcustom mml2015-encrypt-to-self nil
+  "If t, add your own key ID to recipient list when encryption."
+  :group 'mime-security
+  :type 'boolean)
+
 ;;; mailcrypt wrapper
 
 (eval-and-compile
@@ -1172,11 +1177,17 @@ If no one is selected, symmetric encryption will be performed.  "
                    (split-string
                     (message-options-get 'message-recipients)
                     "[ \f\t\n\r\v,]+"))))
+    (if mml2015-encrypt-to-self
+       (setq recipients
+             (nconc recipients
+                    (mapcar (lambda (name)
+                              (car (epg-list-keys context name)))
+                            mml2015-signers))))
     (when sign
       (if mml2015-verbose
          (setq signers (epa-select-keys context "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                                      mml2015-signers t))
+                                        mml2015-signers t))
        (setq signers (mapcar (lambda (name)
                                (car (epg-list-keys context name t)))
                              (or mml2015-signers