diff options
author | Daiki Ueno <ueno@unixuser.org> | 2010-12-16 11:35:56 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@unixuser.org> | 2010-12-16 11:35:56 +0900 |
commit | 33088bedf34fbedb34461fc52c7442a84da12ddc (patch) | |
tree | 0a2184a6bbe2d8ab4ebc13e08d183cf41938df1c /lisp/epa-file.el | |
parent | c0e505e559659276337d7ed0f4f32a99dc39c66e (diff) | |
download | emacs-33088bedf34fbedb34461fc52c7442a84da12ddc.tar.gz |
Extend epa-file-select-keys to allow users to inhibit key selection.
* epa-file.el (epa-file-select-keys): Accept 'silent to inhibit
key selection prompt; make 'silent as default (Bug#7487).
Diffstat (limited to 'lisp/epa-file.el')
-rw-r--r-- | lisp/epa-file.el | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 95d8423020b..3b2663fe0e7 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -35,9 +35,16 @@ way." :type 'boolean :group 'epa-file) -(defcustom epa-file-select-keys nil - "If non-nil, always asks user to select recipients." - :type 'boolean +(defcustom epa-file-select-keys 'silent + "Control whether or not to pop up the key selection dialog. + +If t, always asks user to select recipients. +If nil, query user only when `epa-file-encrypt-to' is not set. +If neither t nor nil, doesn't ask user. In this case, symmetric +encryption is used." + :type '(choice (const :tag "Ask always" t) + (const :tag "Ask when recipients are not set" nil) + (const :tag "Don't ask" silent)) :group 'epa-file) (defvar epa-file-passphrase-alist nil) @@ -218,9 +225,10 @@ way." end (point-max))) (epa-file--encode-coding-string (buffer-substring start end) coding-system)) - (if (or epa-file-select-keys - (not (local-variable-p 'epa-file-encrypt-to - (current-buffer)))) + (if (or (eq epa-file-select-keys t) + (and (null epa-file-select-keys) + (not (local-variable-p 'epa-file-encrypt-to + (current-buffer))))) (epa-select-keys context "Select recipents for encryption. |