Fix bug when a name has no key.

This commit is contained in:
Richard M. Stallman 2012-09-17 05:49:55 -04:00
parent 9b318728ab
commit 69de3ec61f
2 changed files with 24 additions and 18 deletions

View file

@ -1,3 +1,7 @@
2012-09-17 Richard Stallman <rms@gnu.org>
* epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key.
2012-09-17 Chong Yidong <cyd@gnu.org>
* shell.el (shell-file-name-chars, shell-file-name-quote-list)

View file

@ -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