* epa-file.el (epa-file-write-region): Ask recipients only the
authorueno <ueno>
Sat, 21 Apr 2007 03:04:51 +0000 (03:04 +0000)
committerueno <ueno>
Sat, 21 Apr 2007 03:04:51 +0000 (03:04 +0000)
first time.
(epa-file-select-keys): New user option.

ChangeLog
epa-file.el

index df0d0a6..6b6aee0 100644 (file)
--- 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  <ueno@unixuser.org>
 
index 7c75f7c..47b17f5 100644 (file)
@@ -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))