From: Richard M. Stallman Date: Mon, 17 Sep 2012 09:49:55 +0000 (-0400) Subject: Fix bug when a name has no key. X-Git-Tag: emacs-24.2.90~269^2~57 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64;p=emacs.git Fix bug when a name has no key. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 275f7908f5d..d56e0e88f91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-17 Richard Stallman + + * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. + 2012-09-17 Chong Yidong * 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!" 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