From fc5f36eb73c4346ec333f4cd83176a0d17b5997d Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 28 Jul 2006 03:35:08 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 8 ++++++++ lisp/mml1991.el | 11 ++++++++++- lisp/mml2015.el | 15 +++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 614614094..313a17b07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2006-07-28 Daiki Ueno + * 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. diff --git a/lisp/mml1991.el b/lisp/mml1991.el index 44e8c6672..e5439830e 100644 --- a/lisp/mml1991.el +++ b/lisp/mml1991.el @@ -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. diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 54d5f3530..b83077bf3 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -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 -- 2.25.1