emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/epg.el,v


From: Daiki Ueno
Subject: [Emacs-diffs] Changes to emacs/lisp/epg.el,v
Date: Thu, 21 Aug 2008 03:45:25 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Daiki Ueno <ueno>       08/08/21 03:45:24

Index: epg.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epg.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- epg.el      6 May 2008 07:57:34 -0000       1.6
+++ epg.el      21 Aug 2008 03:45:14 -0000      1.7
@@ -185,7 +185,7 @@
   (cons 'epg-context
        (vector (or protocol 'OpenPGP) armor textmode include-certs
                cipher-algorithm digest-algorithm compress-algorithm
-               #'epg-passphrase-callback-function
+               (list #'epg-passphrase-callback-function)
                nil
                nil nil nil nil nil nil)))
 
@@ -328,7 +328,9 @@
   "Set the function used to query passphrase."
   (unless (eq (car-safe context) 'epg-context)
     (signal 'wrong-type-argument (list 'epg-context-p context)))
-  (aset (cdr context) 7 passphrase-callback))
+  (aset (cdr context) 7 (if (consp passphrase-callback)
+                           passphrase-callback
+                         (list passphrase-callback))))
 
 (defun epg-context-set-progress-callback (context
                                          progress-callback)
@@ -336,7 +338,9 @@
 If optional argument HANDBACK is specified, it is passed to PROGRESS-CALLBACK."
   (unless (eq (car-safe context) 'epg-context)
     (signal 'wrong-type-argument (list 'epg-context-p context)))
-  (aset (cdr context) 8 progress-callback))
+  (aset (cdr context) 8 (if (consp progress-callback)
+                           progress-callback
+                         (list progress-callback))))
 
 (defun epg-context-set-signers (context signers)
   "Set the list of key-id for signing."
@@ -1239,13 +1243,10 @@
              (progn
                (setq passphrase
                      (funcall
-                      (if (consp (epg-context-passphrase-callback context))
                           (car (epg-context-passphrase-callback context))
-                        (epg-context-passphrase-callback context))
                       context
                       epg-key-id
-                      (if (consp (epg-context-passphrase-callback context))
-                          (cdr (epg-context-passphrase-callback context)))))
+                      (cdr (epg-context-passphrase-callback context))))
                (when passphrase
                  (setq passphrase-with-new-line (concat passphrase "\n"))
                  (epg--clear-string passphrase)
@@ -1493,16 +1494,13 @@
   (if (and (epg-context-progress-callback context)
           (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
                         string))
-      (funcall (if (consp (epg-context-progress-callback context))
-                  (car (epg-context-progress-callback context))
-                (epg-context-progress-callback context))
+      (funcall (car (epg-context-progress-callback context))
               context
               (match-string 1 string)
               (match-string 2 string)
               (string-to-number (match-string 3 string))
               (string-to-number (match-string 4 string))
-              (if (consp (epg-context-progress-callback context))
-                  (cdr (epg-context-progress-callback context))))))
+              (cdr (epg-context-progress-callback context)))))
 
 (defun epg--status-ENC_TO (context string)
   (if (string-match "\\`\\([0-9A-Za-z]+\\) \\([0-9]+\\) \\([0-9]+\\)" string)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]