summaryrefslogtreecommitdiff
path: root/lisp/epa-mail.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2012-09-17 05:49:55 -0400
committerRichard M. Stallman <rms@gnu.org>2012-09-17 05:49:55 -0400
commit69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64 (patch)
treedab25c25b40db866fb263686f5c4286fbbce1803 /lisp/epa-mail.el
parent9b318728ab4f6fce5c0f5449e80bd8c4bf3bf3a4 (diff)
downloademacs-69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64.tar.gz
Fix bug when a name has no key.
Diffstat (limited to 'lisp/epa-mail.el')
-rw-r--r--lisp/epa-mail.el38
1 files changed, 20 insertions, 18 deletions
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!"
If no one is selected, symmetric encryption will be performed. "
recipients)
(if recipients
- (mapcar
- (lambda (recipient)
- (setq recipient-key
- (epa-mail--find-usable-key
- (epg-list-keys
- (epg-make-context epa-protocol)
- (if (string-match "@" recipient)
- (concat "<" recipient ">")
- recipient))
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format
- "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
+ (apply
+ 'nconc
+ (mapcar
+ (lambda (recipient)
+ (setq recipient-key
+ (epa-mail--find-usable-key
+ (epg-list-keys
+ (epg-make-context epa-protocol)
+ (if (string-match "@" recipient)
+ (concat "<" recipient ">")
+ recipient))
+ 'encrypt))
+ (unless (or recipient-key
+ (y-or-n-p
+ (format
+ "No public key for %s; skip it? "
+ recipient)))
+ (error "No public key for %s" recipient))
+ (if recipient-key (list recipient-key)))
+ recipients))))
(setq sign (if verbose (y-or-n-p "Sign? ")))
(if sign
(epa-select-keys context