From 91888c6ec8d553abc2319ad09b57046e31f553ea Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 21 Apr 2007 03:04:51 +0000 Subject: [PATCH] * epa-file.el (epa-file-write-region): Ask recipients only the first time. (epa-file-select-keys): New user option. --- ChangeLog | 1 + epa-file.el | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index df0d0a6..6b6aee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * epa-file.el (epa-file-write-region): Ask recipients only the first time. + (epa-file-select-keys): New user option. 2007-04-19 Daiki Ueno diff --git a/epa-file.el b/epa-file.el index 7c75f7c..47b17f5 100644 --- a/epa-file.el +++ b/epa-file.el @@ -55,6 +55,11 @@ does that automatically." :type 'boolean :group 'epa-file) +(defcustom epa-file-select-keys nil + "If non-nil, always asks user to select recipients." + :type 'boolean + :group 'epa-file) + (defvar epa-file-encrypt-to nil "*Recipient(s) used for encrypting files. May either be a string or a list of strings.") @@ -221,14 +226,15 @@ May either be a string or a list of strings.") (epa-file--encode-coding-string start coding-system) (epa-file--encode-coding-string (buffer-substring start end) coding-system)) - (if (local-variable-p 'epa-file-encrypt-to) - (if epa-file-encrypt-to - (epg-list-keys context recipients)) - (epa-select-keys - context - "Select recipents for encryption. + (if (or epa-file-select-keys + (not (local-variable-p 'epa-file-encrypt-to))) + (epa-select-keys + context + "Select recipents for encryption. If no one is selected, symmetric encryption will be performed. " - recipients)))) + recipients) + (if epa-file-encrypt-to + (epg-list-keys context recipients))))) (error (if (setq entry (assoc file epa-file-passphrase-alist)) (setcdr entry nil)) -- 1.7.10.4