From: ueno Date: Sat, 21 Apr 2007 03:04:51 +0000 (+0000) Subject: * epa-file.el (epa-file-write-region): Ask recipients only the X-Git-Tag: epg-0_0_12~8 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91888c6ec8d553abc2319ad09b57046e31f553ea;p=elisp%2Fepg.git * epa-file.el (epa-file-write-region): Ask recipients only the first time. (epa-file-select-keys): New user option. --- 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))