From ca6ded8296b46a09a3de03e07a75414e72e3c315 Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 5 Jan 2007 00:28:23 +0000 Subject: [PATCH] * epa.el (epa-encrypt-mail): Ask a user whether to skip a recipient whose public key is not available. --- ChangeLog | 5 +++++ epa.el | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25edac7..e4424b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-05 Daiki Ueno + + * epa.el (epa-encrypt-mail): Ask a user whether to skip a + recipient whose public key is not available. + 2007-01-04 Daiki Ueno * epa.el (epa-decrypt-mail): Renamed from epa-decrypt. diff --git a/epa.el b/epa.el index 579e9a3..d5d8298 100644 --- a/epa.el +++ b/epa.el @@ -1050,7 +1050,7 @@ Don't use this command in Lisp programs!" (save-excursion (let ((verbose current-prefix-arg) (context (epg-make-context epa-protocol)) - recipients) + recipients recipient-keys) (goto-char (point-min)) (when (epa--mail-mode-p) (save-restriction @@ -1082,14 +1082,21 @@ Don't use this command in Lisp programs!" If no one is selected, symmetric encryption will be performed. " recipients) (if recipients - (delq nil - (apply #'nconc - (mapcar - (lambda (recipient) + (apply #'nconc + (mapcar + (lambda (recipient) + (setq recipient-keys (epg-list-keys (epg-make-context epa-protocol) (concat "<" recipient ">"))) - recipients))))) + (unless (or recipient-keys + (y-or-n-p + (format + "No public key for %s; skip it? " + recipient))) + (error "No public key for %s" recipient)) + recipient-keys) + recipients)))) (setq sign (if verbose (y-or-n-p "Sign? "))) (if sign (epa-select-keys context -- 1.7.10.4