Commit ff4871b9 authored by Glenn Morris's avatar Glenn Morris

* lisp/epa.el (epa-read-file-name): New function.

(epa-decrypt-file): Make plain-file optional.  Use epa-read-file-name.

* doc/misc/epa.texi (Cryptographic operations on files): Update epa-decrypt-file.

Fixes: debbugs:14510
parent ad257d4f
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.texi (Cryptographic operations on files): Update epa-decrypt-file.
2013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Article Date):
......
......@@ -240,8 +240,9 @@ you answered yes, it will let you select the signing keys.
@node Cryptographic operations on files
@section Cryptographic operations on files
@deffn Command epa-decrypt-file file
Decrypt @var{file}.
@deffn Command epa-decrypt-file file &optional output
Decrypt @var{file}. If you do not specify the name @var{output} to
use for the decrypted file, this function prompts for the value to use.
@end deffn
@deffn Command epa-verify-file file
......
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.el (epa-read-file-name): New function. (Bug#14510)
(epa-decrypt-file): Make plain-file optional. Use epa-read-file-name.
2013-06-09 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-command-p): Fix bug that caused
......@@ -620,21 +620,24 @@ If SECRET is non-nil, list secret keys instead of public keys."
(floor (* (/ current (float total)) 100))))
(message "%s..." prompt))))
(defun epa-read-file-name (input)
"Interactively read an output file name based on INPUT file name."
(setq input (file-name-sans-extension (expand-file-name input)))
(expand-file-name
(read-file-name
(concat "To file (default " (file-name-nondirectory input) ") ")
(file-name-directory input)
input)))
;;;###autoload
(defun epa-decrypt-file (decrypt-file plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE."
(defun epa-decrypt-file (decrypt-file &optional plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE.
If you do not specify PLAIN-FILE, this functions prompts for the value to use."
(interactive
(let (file default-name plain)
(setq file (read-file-name "File to decrypt: "))
(setq default-name (file-name-sans-extension (expand-file-name file)))
(setq plain (expand-file-name
(read-file-name
(concat "To file (default "
(file-name-nondirectory default-name)
") ")
(file-name-directory default-name)
default-name)))
(let* ((file (read-file-name "File to decrypt: "))
(plain (epa-read-file-name file)))
(list file plain)))
(or plain-file (setq plain-file (epa-read-file-name decrypt-file)))
(setq decrypt-file (expand-file-name decrypt-file))
(let ((context (epg-make-context epa-protocol)))
(epg-context-set-passphrase-callback context
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment