summaryrefslogtreecommitdiff
path: root/lisp/epa-mail.el
diff options
context:
space:
mode:
authorRichard M Stallman <rms@gnu.org>2020-09-30 18:44:42 -0400
committerRichard Stallman <rms@gnu.org>2020-09-30 18:44:42 -0400
commitdc3a59f7a17aa8a643d688a10ab175430decb544 (patch)
treebeda79f8d8b15b857bccdf0a1a13eab513e67c06 /lisp/epa-mail.el
parent0434c1a9a66a3521348cbca9c1f3bba7765df2d6 (diff)
downloademacs-dc3a59f7a17aa8a643d688a10ab175430decb544.tar.gz
When recipient has no public key, make offer to skip it optional.
* epa-mail.el (epa-mail-offer-skip): New option. (epa-mail-encrypt): If epa-mail-offer-skip is nil, don't offer to skip a keyless recipient, just cause error.
Diffstat (limited to 'lisp/epa-mail.el')
-rw-r--r--lisp/epa-mail.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index 6e6c0a498d2..3ad4da16c89 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -49,6 +49,13 @@
(defvar epa-mail-mode-on-hook nil)
(defvar epa-mail-mode-off-hook nil)
+(defcustom epa-mail-offer-skip t
+ "If non-nil, when a recipient has no key, ask whether to skip it.
+Otherwise, signal an error."
+ :type 'boolean
+ :version "28.1"
+ :group 'epa-mail)
+
;;;###autoload
(define-minor-mode epa-mail-mode
"A minor-mode for composing encrypted/clearsigned mails."
@@ -218,10 +225,12 @@ If no one is selected, symmetric encryption will be performed. "
recipient))
'encrypt)))
(unless (or recipient-key
- (y-or-n-p
- (format
- "No public key for %s; skip it? "
- recipient)))
+ (and epa-mail-offer-skip
+ (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))))
default-recipients)))))