[gnus git] branch master updated: =1= Give mml2015-signers higher precedence over mml2015-sign-with-sender.

Daiki Ueno <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  5999faaca088e8ef129ea6b2b7ee7329e3fa57a2 (commit)
      from  4624bfec8a2dce144eb7f98e8751a41ae9bcb2a8 (commit)


- Log -----------------------------------------------------------------
commit 5999faaca088e8ef129ea6b2b7ee7329e3fa57a2
Author: Daiki Ueno <[email protected]>
Date:   Fri Jan 28 10:02:59 2011 +0900

    Give mml2015-signers higher precedence over mml2015-sign-with-sender.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 747c9e9..68a8f80 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-28  Daiki Ueno  <[email protected]>
+
+	* mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Give
+	mml2015-signers higher precedence over mml2015-sign-with-sender.
+
 2011-01-27  Lars Ingebrigtsen  <[email protected]>
 
 	* gnus-group.el (gnus-group-refresh-group): Refresh even non-visible
diff --git a/lisp/mml2015.el b/lisp/mml2015.el
index 735f3b6..1271168 100644
--- a/lisp/mml2015.el
+++ b/lisp/mml2015.el
@@ -116,7 +116,8 @@ Whether the passphrase is cached at all is controlled by
   :type 'integer)
 
 (defcustom mml2015-signers nil
-  "A list of your own 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.
+If set, it overrides the setting of `mml2015-sign-with-sender'."
   :group 'mime-security
   :type '(repeat (string :tag "Key ID")))
 
@@ -965,8 +966,10 @@ Whether the passphrase is cached at all is controlled by
   (let* ((inhibit-redisplay t)
 	 (context (epg-make-context))
 	 (boundary (mml-compute-boundary cont))
-	 (sender (when mml2015-sign-with-sender
-                   (message-options-get 'message-sender)))
+	 (sender (message-options-get 'message-sender))
+	 (signer-names (or mml2015-signers
+			   (if (and mml2015-sign-with-sender sender)
+			       (list (concat "<" sender ">")))))
 	 signer-key
 	 (signers
 	  (or (message-options-get 'mml2015-epg-signers)
@@ -976,10 +979,7 @@ Whether the passphrase is cached at all is controlled by
 		   (epa-select-keys context "\
 Select keys for signing.
 If no one is selected, default secret key is used.  "
-				    (if sender
-					(cons (concat "<" sender ">")
-					      mml2015-signers)
-				      mml2015-signers)
+				    signer-names
 				    t)
 		 (if (or sender mml2015-signers)
 		     (delq nil
@@ -995,10 +995,7 @@ If no one is selected, default secret key is used.  "
 					    signer)))
 				(error "No secret key for %s" signer))
 			      signer-key)
-			    (if sender
-				(cons (concat "<" sender ">")
-				      mml2015-signers)
-			      mml2015-signers))))))))
+			    signer-names)))))))
 	 signature micalg)
     (epg-context-set-armor context t)
     (epg-context-set-textmode context t)
@@ -1038,14 +1035,17 @@ If no one is selected, default secret key is used.  "
     (goto-char (point-max))))
 
 (defun mml2015-epg-encrypt (cont &optional sign)
-  (let ((inhibit-redisplay t)
+  (let* ((inhibit-redisplay t)
 	(context (epg-make-context))
+	 (boundary (mml-compute-boundary cont))
 	(config (epg-configuration))
-	(sender (when mml2015-sign-with-sender
-                  (message-options-get 'message-sender)))
 	(recipients (message-options-get 'mml2015-epg-recipients))
-	cipher signers
-	(boundary (mml-compute-boundary cont))
+	 cipher
+	 (sender (message-options-get 'message-sender))
+	 (signer-names (or mml2015-signers
+			   (if (and mml2015-sign-with-sender sender)
+			       (list (concat "<" sender ">")))))
+	 signers
 	recipient-key signer-key)
     (unless recipients
       (setq recipients
@@ -1060,12 +1060,9 @@ If no one is selected, default secret key is used.  "
 					      (read-string "Recipients: ")))
 		     "[ \f\t\n\r\v,]+"))))
       (when mml2015-encrypt-to-self
-	(unless (or sender mml2015-signers)
-	  (error "Message sender and mml2015-signers not set"))
-	(setq recipients (nconc recipients (if sender
-					       (cons (concat "<" sender ">")
-						     mml2015-signers)
-					     mml2015-signers))))
+	(unless signer-names
+	  (error "Neither message sender nor mml2015-signers are set"))
+	(setq recipients (nconc recipients signer-names)))
       (if (eq mm-encrypt-option 'guided)
 	  (setq recipients
 		(epa-select-keys context "\
@@ -1098,10 +1095,7 @@ If no one is selected, symmetric encryption will be performed.  "
 		     (epa-select-keys context "\
 Select keys for signing.
 If no one is selected, default secret key is used.  "
-				      (if sender
-					  (cons (concat "<" sender ">")
-						mml2015-signers)
-					mml2015-signers)
+				      signer-names
 				      t)
 		   (if (or sender mml2015-signers)
 		       (delq nil
@@ -1117,9 +1111,7 @@ If no one is selected, default secret key is used.  "
 					      signer)))
 				  (error "No secret key for %s" signer))
 				signer-key)
-			      (if sender
-				  (cons (concat "<" sender ">") mml2015-signers)
-				mml2015-signers))))))))
+			      signer-names)))))))
       (epg-context-set-signers context signers))
     (epg-context-set-armor context t)
     (epg-context-set-textmode context t)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog  |    5 ++++
 lisp/mml2015.el |   58 +++++++++++++++++++++++-------------------------------
 2 files changed, 30 insertions(+), 33 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.