X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/220d91b834f7f7252b9953460422151b86b3520c..6420d28b9ab9c09b69992e05e0e63c3bbaf2646d:/lisp/epa-file.el diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 95d8423020..aa9915d8cf 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -1,5 +1,5 @@ -;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -*- lexical-binding: t -*- +;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Keywords: PGP, GnuPG @@ -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. @@ -290,5 +298,4 @@ If no one is selected, symmetric encryption will be performed. ")))) (provide 'epa-file) -;; arch-tag: 5715152f-0eb1-4dbc-9008-07098775314d ;;; epa-file.el ends here