From 446b12da60f307f6be854cae341be194213a5ab1 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sun, 10 Oct 2010 10:45:45 +0900 Subject: [PATCH] Simplify 2010-10-09T13:27:24Z!larsi@gnus.org. * epa.el (epa-passphrase-callback-function): Display filename passed as the 3rd arg. * epa-file.el (epa-file-passphrase-callback-function): Pass filename to epa-passphrase-callback-function. --- lisp/ChangeLog | 7 +++++++ lisp/epa-file.el | 5 +++-- lisp/epa.el | 10 ++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 330be221a60..f05defb968f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2010-10-10 Daiki Ueno + + * epa.el (epa-passphrase-callback-function): Display filename + passed as the 3rd arg. + * epa-file.el (epa-file-passphrase-callback-function): Pass + filename to epa-passphrase-callback-function. + 2010-10-09 Chong Yidong * cus-edit.el (custom-face-widget-to-spec) diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 3c6cf07ea1b..95d8423020b 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -67,10 +67,11 @@ way." (cons entry epa-file-passphrase-alist))) (setq passphrase (epa-passphrase-callback-function context - key-id nil)) + key-id + file)) (setcdr entry (copy-sequence passphrase)) passphrase)))) - (epa-passphrase-callback-function context key-id nil))) + (epa-passphrase-callback-function context key-id file))) ;;;###autoload (defun epa-file-handler (operation &rest args) diff --git a/lisp/epa.el b/lisp/epa.el index 49ff3455c23..ca0f07d5bae 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -637,12 +637,10 @@ If SECRET is non-nil, list secret keys instead of public keys." (if (eq key-id 'SYM) (read-passwd (format "Passphrase for symmetric encryption%s: " - (let ((elem (epg-context-passphrase-callback context))) - ;; Add the file name to the prompt, if any. - (if (and (consp elem) - (stringp (cdr elem))) - (format " for %s" (cdr elem)) - ""))) + ;; Add the file name to the prompt, if any. + (if (stringp handback) + (format " for %s" handback) + "")) (eq (epg-context-operation context) 'encrypt)) (read-passwd (if (eq key-id 'PIN) -- 2.39.5