* epg.el (epg-status-GET_HIDDEN): Pass epg-context as the first
authorueno <ueno>
Wed, 26 Apr 2006 03:01:30 +0000 (03:01 +0000)
committerueno <ueno>
Wed, 26 Apr 2006 03:01:30 +0000 (03:01 +0000)
argument of passphrase-callback.
(epg-status-PROGRESS): Ditto.

ChangeLog
epa-file.el
epg.el
pgg-epg.el

index 1514622..e35d288 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-26  Daiki Ueno  <ueno@unixuser.org>
 
+       * 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  <ueno@unixuser.org>
+
        * epa.el (epa-select-keys): Don't set inhibit-quit when
        recursive-edit is called.
        (epg-cancel): New function.
index 435976c..a489bab 100644 (file)
@@ -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)
                (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 (file)
--- 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 ()
index d7baf12..6963113 100644 (file)
@@ -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