aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2012-09-17 05:49:55 -0400
committerRichard M. Stallman2012-09-17 05:49:55 -0400
commit69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64 (patch)
treedab25c25b40db866fb263686f5c4286fbbce1803
parent9b318728ab4f6fce5c0f5449e80bd8c4bf3bf3a4 (diff)
downloademacs-69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64.tar.gz
emacs-69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64.zip
Fix bug when a name has no key.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/epa-mail.el38
2 files changed, 24 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 275f7908f5d..d56e0e88f91 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-09-17 Richard Stallman <rms@gnu.org>
2
3 * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key.
4
12012-09-17 Chong Yidong <cyd@gnu.org> 52012-09-17 Chong Yidong <cyd@gnu.org>
2 6
3 * shell.el (shell-file-name-chars, shell-file-name-quote-list) 7 * shell.el (shell-file-name-chars, shell-file-name-quote-list)
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index be5b849651c..a16fa5abdd4 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -170,24 +170,26 @@ Don't use this command in Lisp programs!"
170If no one is selected, symmetric encryption will be performed. " 170If no one is selected, symmetric encryption will be performed. "
171 recipients) 171 recipients)
172 (if recipients 172 (if recipients
173 (mapcar 173 (apply
174 (lambda (recipient) 174 'nconc
175 (setq recipient-key 175 (mapcar
176 (epa-mail--find-usable-key 176 (lambda (recipient)
177 (epg-list-keys 177 (setq recipient-key
178 (epg-make-context epa-protocol) 178 (epa-mail--find-usable-key
179 (if (string-match "@" recipient) 179 (epg-list-keys
180 (concat "<" recipient ">") 180 (epg-make-context epa-protocol)
181 recipient)) 181 (if (string-match "@" recipient)
182 'encrypt)) 182 (concat "<" recipient ">")
183 (unless (or recipient-key 183 recipient))
184 (y-or-n-p 184 'encrypt))
185 (format 185 (unless (or recipient-key
186 "No public key for %s; skip it? " 186 (y-or-n-p
187 recipient))) 187 (format
188 (error "No public key for %s" recipient)) 188 "No public key for %s; skip it? "
189 recipient-key) 189 recipient)))
190 recipients))) 190 (error "No public key for %s" recipient))
191 (if recipient-key (list recipient-key)))
192 recipients))))
191 (setq sign (if verbose (y-or-n-p "Sign? "))) 193 (setq sign (if verbose (y-or-n-p "Sign? ")))
192 (if sign 194 (if sign
193 (epa-select-keys context 195 (epa-select-keys context