aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2008-08-21 03:45:14 +0000
committerDaiki Ueno2008-08-21 03:45:14 +0000
commit7c0ffa6da650fbf01df3e15eca018e09f70968a2 (patch)
tree75cb88c808cdbfb1f8f0480c7fe2e82e17c1deaa
parenta2d3af1ce6b6f8945cfb2c619e541ca8ab428244 (diff)
downloademacs-7c0ffa6da650fbf01df3e15eca018e09f70968a2.tar.gz
emacs-7c0ffa6da650fbf01df3e15eca018e09f70968a2.zip
(epg-make-context, epg-context-set-passphrase-callback)
(epg-context-set-progress-callback): Make sure the callback is a cons of a function and a handback. Update all callers.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/epg.el24
2 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ef23d308cc3..4c736754a6e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-08-21 Daiki Ueno <ueno@unixuser.org>
2
3 * epg.el (epg-make-context, epg-context-set-passphrase-callback)
4 (epg-context-set-progress-callback): Make sure the callback is a
5 cons of a function and a handback. Update all callers.
6
12008-08-20 David Reitter <david.reitter@gmail.com> 72008-08-20 David Reitter <david.reitter@gmail.com>
2 8
3 * term/ns-win.el (ns-cursor-blink-rate, ns-cursor-blink-mode): Remove. 9 * term/ns-win.el (ns-cursor-blink-rate, ns-cursor-blink-mode): Remove.
diff --git a/lisp/epg.el b/lisp/epg.el
index b7d973266f6..7ad0d34b4b0 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -185,7 +185,7 @@
185 (cons 'epg-context 185 (cons 'epg-context
186 (vector (or protocol 'OpenPGP) armor textmode include-certs 186 (vector (or protocol 'OpenPGP) armor textmode include-certs
187 cipher-algorithm digest-algorithm compress-algorithm 187 cipher-algorithm digest-algorithm compress-algorithm
188 #'epg-passphrase-callback-function 188 (list #'epg-passphrase-callback-function)
189 nil 189 nil
190 nil nil nil nil nil nil))) 190 nil nil nil nil nil nil)))
191 191
@@ -328,7 +328,9 @@ This function is for internal use only."
328 "Set the function used to query passphrase." 328 "Set the function used to query passphrase."
329 (unless (eq (car-safe context) 'epg-context) 329 (unless (eq (car-safe context) 'epg-context)
330 (signal 'wrong-type-argument (list 'epg-context-p context))) 330 (signal 'wrong-type-argument (list 'epg-context-p context)))
331 (aset (cdr context) 7 passphrase-callback)) 331 (aset (cdr context) 7 (if (consp passphrase-callback)
332 passphrase-callback
333 (list passphrase-callback))))
332 334
333(defun epg-context-set-progress-callback (context 335(defun epg-context-set-progress-callback (context
334 progress-callback) 336 progress-callback)
@@ -336,7 +338,9 @@ This function is for internal use only."
336If optional argument HANDBACK is specified, it is passed to PROGRESS-CALLBACK." 338If optional argument HANDBACK is specified, it is passed to PROGRESS-CALLBACK."
337 (unless (eq (car-safe context) 'epg-context) 339 (unless (eq (car-safe context) 'epg-context)
338 (signal 'wrong-type-argument (list 'epg-context-p context))) 340 (signal 'wrong-type-argument (list 'epg-context-p context)))
339 (aset (cdr context) 8 progress-callback)) 341 (aset (cdr context) 8 (if (consp progress-callback)
342 progress-callback
343 (list progress-callback))))
340 344
341(defun epg-context-set-signers (context signers) 345(defun epg-context-set-signers (context signers)
342 "Set the list of key-id for signing." 346 "Set the list of key-id for signing."
@@ -1239,13 +1243,10 @@ This function is for internal use only."
1239 (progn 1243 (progn
1240 (setq passphrase 1244 (setq passphrase
1241 (funcall 1245 (funcall
1242 (if (consp (epg-context-passphrase-callback context)) 1246 (car (epg-context-passphrase-callback context))
1243 (car (epg-context-passphrase-callback context))
1244 (epg-context-passphrase-callback context))
1245 context 1247 context
1246 epg-key-id 1248 epg-key-id
1247 (if (consp (epg-context-passphrase-callback context)) 1249 (cdr (epg-context-passphrase-callback context))))
1248 (cdr (epg-context-passphrase-callback context)))))
1249 (when passphrase 1250 (when passphrase
1250 (setq passphrase-with-new-line (concat passphrase "\n")) 1251 (setq passphrase-with-new-line (concat passphrase "\n"))
1251 (epg--clear-string passphrase) 1252 (epg--clear-string passphrase)
@@ -1493,16 +1494,13 @@ This function is for internal use only."
1493 (if (and (epg-context-progress-callback context) 1494 (if (and (epg-context-progress-callback context)
1494 (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)" 1495 (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
1495 string)) 1496 string))
1496 (funcall (if (consp (epg-context-progress-callback context)) 1497 (funcall (car (epg-context-progress-callback context))
1497 (car (epg-context-progress-callback context))
1498 (epg-context-progress-callback context))
1499 context 1498 context
1500 (match-string 1 string) 1499 (match-string 1 string)
1501 (match-string 2 string) 1500 (match-string 2 string)
1502 (string-to-number (match-string 3 string)) 1501 (string-to-number (match-string 3 string))
1503 (string-to-number (match-string 4 string)) 1502 (string-to-number (match-string 4 string))
1504 (if (consp (epg-context-progress-callback context)) 1503 (cdr (epg-context-progress-callback context)))))
1505 (cdr (epg-context-progress-callback context))))))
1506 1504
1507(defun epg--status-ENC_TO (context string) 1505(defun epg--status-ENC_TO (context string)
1508 (if (string-match "\\`\\([0-9A-Za-z]+\\) \\([0-9]+\\) \\([0-9]+\\)" string) 1506 (if (string-match "\\`\\([0-9A-Za-z]+\\) \\([0-9]+\\) \\([0-9]+\\)" string)