diff options
| author | Daiki Ueno | 2011-01-28 01:34:09 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-01-28 01:34:09 +0000 |
| commit | bb760c5da820ddf0fa0efe5e55b555ff8389675d (patch) | |
| tree | 5550bb011557826489a22e06ec5611b54b8f00eb | |
| parent | 8bb578b203e08150696165d8abe8bac7dc349e40 (diff) | |
| download | emacs-bb760c5da820ddf0fa0efe5e55b555ff8389675d.tar.gz emacs-bb760c5da820ddf0fa0efe5e55b555ff8389675d.zip | |
mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Give mml2015-signers higher precedence over mml2015-sign-with-sender.
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/mml2015.el | 58 |
2 files changed, 30 insertions, 33 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 60c784b4119..66373f5bbbc 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-01-28 Daiki Ueno <ueno@unixuser.org> | ||
| 2 | |||
| 3 | * mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Give | ||
| 4 | mml2015-signers higher precedence over mml2015-sign-with-sender. | ||
| 5 | |||
| 1 | 2011-01-27 Lars Ingebrigtsen <larsi@gnus.org> | 6 | 2011-01-27 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 7 | ||
| 3 | * gnus-group.el (gnus-group-refresh-group): Refresh even non-visible | 8 | * gnus-group.el (gnus-group-refresh-group): Refresh even non-visible |
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 735f3b649e1..1271168fffc 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el | |||
| @@ -116,7 +116,8 @@ Whether the passphrase is cached at all is controlled by | |||
| 116 | :type 'integer) | 116 | :type 'integer) |
| 117 | 117 | ||
| 118 | (defcustom mml2015-signers nil | 118 | (defcustom mml2015-signers nil |
| 119 | "A list of your own key ID which will be used to sign a message." | 119 | "A list of your own key ID which will be used to sign a message. |
| 120 | If set, it overrides the setting of `mml2015-sign-with-sender'." | ||
| 120 | :group 'mime-security | 121 | :group 'mime-security |
| 121 | :type '(repeat (string :tag "Key ID"))) | 122 | :type '(repeat (string :tag "Key ID"))) |
| 122 | 123 | ||
| @@ -965,8 +966,10 @@ Whether the passphrase is cached at all is controlled by | |||
| 965 | (let* ((inhibit-redisplay t) | 966 | (let* ((inhibit-redisplay t) |
| 966 | (context (epg-make-context)) | 967 | (context (epg-make-context)) |
| 967 | (boundary (mml-compute-boundary cont)) | 968 | (boundary (mml-compute-boundary cont)) |
| 968 | (sender (when mml2015-sign-with-sender | 969 | (sender (message-options-get 'message-sender)) |
| 969 | (message-options-get 'message-sender))) | 970 | (signer-names (or mml2015-signers |
| 971 | (if (and mml2015-sign-with-sender sender) | ||
| 972 | (list (concat "<" sender ">"))))) | ||
| 970 | signer-key | 973 | signer-key |
| 971 | (signers | 974 | (signers |
| 972 | (or (message-options-get 'mml2015-epg-signers) | 975 | (or (message-options-get 'mml2015-epg-signers) |
| @@ -976,10 +979,7 @@ Whether the passphrase is cached at all is controlled by | |||
| 976 | (epa-select-keys context "\ | 979 | (epa-select-keys context "\ |
| 977 | Select keys for signing. | 980 | Select keys for signing. |
| 978 | If no one is selected, default secret key is used. " | 981 | If no one is selected, default secret key is used. " |
| 979 | (if sender | 982 | signer-names |
| 980 | (cons (concat "<" sender ">") | ||
| 981 | mml2015-signers) | ||
| 982 | mml2015-signers) | ||
| 983 | t) | 983 | t) |
| 984 | (if (or sender mml2015-signers) | 984 | (if (or sender mml2015-signers) |
| 985 | (delq nil | 985 | (delq nil |
| @@ -995,10 +995,7 @@ If no one is selected, default secret key is used. " | |||
| 995 | signer))) | 995 | signer))) |
| 996 | (error "No secret key for %s" signer)) | 996 | (error "No secret key for %s" signer)) |
| 997 | signer-key) | 997 | signer-key) |
| 998 | (if sender | 998 | signer-names))))))) |
| 999 | (cons (concat "<" sender ">") | ||
| 1000 | mml2015-signers) | ||
| 1001 | mml2015-signers)))))))) | ||
| 1002 | signature micalg) | 999 | signature micalg) |
| 1003 | (epg-context-set-armor context t) | 1000 | (epg-context-set-armor context t) |
| 1004 | (epg-context-set-textmode context t) | 1001 | (epg-context-set-textmode context t) |
| @@ -1038,15 +1035,18 @@ If no one is selected, default secret key is used. " | |||
| 1038 | (goto-char (point-max)))) | 1035 | (goto-char (point-max)))) |
| 1039 | 1036 | ||
| 1040 | (defun mml2015-epg-encrypt (cont &optional sign) | 1037 | (defun mml2015-epg-encrypt (cont &optional sign) |
| 1041 | (let ((inhibit-redisplay t) | 1038 | (let* ((inhibit-redisplay t) |
| 1042 | (context (epg-make-context)) | 1039 | (context (epg-make-context)) |
| 1043 | (config (epg-configuration)) | 1040 | (boundary (mml-compute-boundary cont)) |
| 1044 | (sender (when mml2015-sign-with-sender | 1041 | (config (epg-configuration)) |
| 1045 | (message-options-get 'message-sender))) | 1042 | (recipients (message-options-get 'mml2015-epg-recipients)) |
| 1046 | (recipients (message-options-get 'mml2015-epg-recipients)) | 1043 | cipher |
| 1047 | cipher signers | 1044 | (sender (message-options-get 'message-sender)) |
| 1048 | (boundary (mml-compute-boundary cont)) | 1045 | (signer-names (or mml2015-signers |
| 1049 | recipient-key signer-key) | 1046 | (if (and mml2015-sign-with-sender sender) |
| 1047 | (list (concat "<" sender ">"))))) | ||
| 1048 | signers | ||
| 1049 | recipient-key signer-key) | ||
| 1050 | (unless recipients | 1050 | (unless recipients |
| 1051 | (setq recipients | 1051 | (setq recipients |
| 1052 | (apply #'nconc | 1052 | (apply #'nconc |
| @@ -1060,12 +1060,9 @@ If no one is selected, default secret key is used. " | |||
| 1060 | (read-string "Recipients: "))) | 1060 | (read-string "Recipients: "))) |
| 1061 | "[ \f\t\n\r\v,]+")))) | 1061 | "[ \f\t\n\r\v,]+")))) |
| 1062 | (when mml2015-encrypt-to-self | 1062 | (when mml2015-encrypt-to-self |
| 1063 | (unless (or sender mml2015-signers) | 1063 | (unless signer-names |
| 1064 | (error "Message sender and mml2015-signers not set")) | 1064 | (error "Neither message sender nor mml2015-signers are set")) |
| 1065 | (setq recipients (nconc recipients (if sender | 1065 | (setq recipients (nconc recipients signer-names))) |
| 1066 | (cons (concat "<" sender ">") | ||
| 1067 | mml2015-signers) | ||
| 1068 | mml2015-signers)))) | ||
| 1069 | (if (eq mm-encrypt-option 'guided) | 1066 | (if (eq mm-encrypt-option 'guided) |
| 1070 | (setq recipients | 1067 | (setq recipients |
| 1071 | (epa-select-keys context "\ | 1068 | (epa-select-keys context "\ |
| @@ -1098,10 +1095,7 @@ If no one is selected, symmetric encryption will be performed. " | |||
| 1098 | (epa-select-keys context "\ | 1095 | (epa-select-keys context "\ |
| 1099 | Select keys for signing. | 1096 | Select keys for signing. |
| 1100 | If no one is selected, default secret key is used. " | 1097 | If no one is selected, default secret key is used. " |
| 1101 | (if sender | 1098 | signer-names |
| 1102 | (cons (concat "<" sender ">") | ||
| 1103 | mml2015-signers) | ||
| 1104 | mml2015-signers) | ||
| 1105 | t) | 1099 | t) |
| 1106 | (if (or sender mml2015-signers) | 1100 | (if (or sender mml2015-signers) |
| 1107 | (delq nil | 1101 | (delq nil |
| @@ -1117,9 +1111,7 @@ If no one is selected, default secret key is used. " | |||
| 1117 | signer))) | 1111 | signer))) |
| 1118 | (error "No secret key for %s" signer)) | 1112 | (error "No secret key for %s" signer)) |
| 1119 | signer-key) | 1113 | signer-key) |
| 1120 | (if sender | 1114 | signer-names))))))) |
| 1121 | (cons (concat "<" sender ">") mml2015-signers) | ||
| 1122 | mml2015-signers)))))))) | ||
| 1123 | (epg-context-set-signers context signers)) | 1115 | (epg-context-set-signers context signers)) |
| 1124 | (epg-context-set-armor context t) | 1116 | (epg-context-set-armor context t) |
| 1125 | (epg-context-set-textmode context t) | 1117 | (epg-context-set-textmode context t) |