From 24fc90ba90721aa285c6bd2e10b757ffb64b1d5a Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 29 Nov 2006 09:54:38 +0000 Subject: [PATCH] 2006-11-20 Andreas Seltenreich * epa-file.el (epa-file-encrypt-to): New file local variable. (epa-file-write-region): Specify recipients by epa-file-encrypt-to. --- ChangeLog | 5 +++++ epa-file.el | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b2a49c1..4d973fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-20 Andreas Seltenreich + + * epa-file.el (epa-file-encrypt-to): New file local variable. + (epa-file-write-region): Specify recipients by epa-file-encrypt-to. + 2006-11-26 Daiki Ueno * epa.el (epa-sign-file): Query signature type at a time. diff --git a/epa-file.el b/epa-file.el index ff5b65f..a924aa7 100644 --- a/epa-file.el +++ b/epa-file.el @@ -39,6 +39,22 @@ :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.") + +;;;###autoload +(put 'epa-file-encrypt-to 'safe-local-variable + (lambda (val) + (or (stringp val) + (and (listp val) + (catch 'safe + (mapc (lambda (elt) + (unless (stringp elt) + (throw 'safe nil))) + val) + t))))) + (defvar epa-file-handler (cons epa-file-name-regexp 'epa-file-handler)) @@ -166,7 +182,10 @@ (epa-select-keys context "Select recipents for encryption. -If no one is selected, symmetric encryption will be performed. ")))) +If no one is selected, symmetric encryption will be performed. " + (cond + ((listp epa-file-encrypt-to) epa-file-encrypt-to) + ((stringp epa-file-encrypt-to) (list epa-file-encrypt-to))))))) (error (if (setq entry (assoc file epa-file-passphrase-alist)) (setcdr entry nil)) -- 1.7.10.4