From f38e3ffad2fbca4d6d3a5ab4190527f90f77a903 Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 26 Apr 2006 03:01:30 +0000 Subject: [PATCH] * epg.el (epg-status-GET_HIDDEN): Pass epg-context as the first argument of passphrase-callback. (epg-status-PROGRESS): Ditto. --- ChangeLog | 6 ++++++ epa-file.el | 7 ++++--- epg.el | 9 ++++++--- pgg-epg.el | 4 ++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1514622..e35d288 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-04-26 Daiki Ueno + * epg.el (epg-status-GET_HIDDEN): Pass epg-context as the first + argument of passphrase-callback. + (epg-status-PROGRESS): Ditto. + +2006-04-26 Daiki Ueno + * epa.el (epa-select-keys): Don't set inhibit-quit when recursive-edit is called. (epg-cancel): New function. diff --git a/epa-file.el b/epa-file.el index 435976c..a489bab 100644 --- a/epa-file.el +++ b/epa-file.el @@ -39,7 +39,7 @@ (defvar epa-file-passphrase-alist nil) -(defun epa-file-passphrase-callback-function (key-id file) +(defun epa-file-passphrase-callback-function (context key-id file) (if (eq key-id 'SYM) (let ((entry (assoc file epa-file-passphrase-alist)) passphrase) @@ -49,10 +49,11 @@ (setq entry (list file) epa-file-passphrase-alist (cons entry epa-file-passphrase-alist))) - (setq passphrase (epg-passphrase-callback-function key-id nil)) + (setq passphrase (epg-passphrase-callback-function context + key-id nil)) (setcdr entry (copy-sequence passphrase)) passphrase))) - (epg-passphrase-callback-function key-id nil))) + (epg-passphrase-callback-function context key-id nil))) (defun epa-file-handler (operation &rest args) (save-match-data diff --git a/epg.el b/epg.el index e7e4e6a..4a41245 100644 --- a/epg.el +++ b/epg.el @@ -602,6 +602,7 @@ This function is for internal use only." (progn (setq passphrase (funcall + epg-context (if (consp (epg-context-passphrase-callback epg-context)) (car (epg-context-passphrase-callback @@ -772,7 +773,8 @@ This function is for internal use only." (defun epg-status-PROGRESS (process string) (if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)" string) - (funcall (if (consp (epg-context-progress-callback epg-context)) + (funcall epg-context + (if (consp (epg-context-progress-callback epg-context)) (car (epg-context-progress-callback epg-context)) (epg-context-progress-callback epg-context)) (match-string 1 string) @@ -855,7 +857,7 @@ This function is for internal use only." (cons 'fingerprint (substring string (match-end 0)))) (epg-context-result-for epg-context 'sign))))) -(defun epg-passphrase-callback-function (key-id handback) +(defun epg-passphrase-callback-function (context key-id handback) (read-passwd (if (eq key-id 'SYM) "Passphrase for symmetric encryption: " @@ -866,7 +868,8 @@ This function is for internal use only." (format "Passphrase for %s %s: " key-id (cdr entry)) (format "Passphrase for %s: " key-id))))))) -(defun epg-progress-callback-function (what char current total handback) +(defun epg-progress-callback-function (context what char current total + handback) (message "%s: %d%%/%d%%" what current total)) (defun epg-configuration () diff --git a/pgg-epg.el b/pgg-epg.el index d7baf12..6963113 100644 --- a/pgg-epg.el +++ b/pgg-epg.el @@ -30,9 +30,9 @@ (defvar pgg-epg-secret-key-id-list nil) -(defun pgg-epg-passphrase-callback (key-id ignore) +(defun pgg-epg-passphrase-callback (context key-id ignore) (if (eq key-id 'SYM) - (epg-passphrase-callback-function key-id nil) + (epg-passphrase-callback-function context key-id nil) (let* ((entry (assoc key-id epg-user-id-alist)) (passphrase (pgg-read-passphrase -- 1.7.10.4