From: hmurata Date: Wed, 22 Nov 2006 14:11:30 +0000 (+0000) Subject: (epg-context-set-passphrase-callback): Add optional X-Git-Tag: epg-0_0_8~12 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db9bcd815464d0dab6a8853e6437848527b1a8eb;p=elisp%2Fepg.git (epg-context-set-passphrase-callback): Add optional argument `handback'. (epg-context-set-progress-callback): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 9237c38..67b37e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-11-22 Hiroya Murata + + * epg.el (epg-context-set-passphrase-callback): Add optional + argument `handback'. + (epg-context-set-progress-callback): Ditto. + 2006-11-14 Daiki Ueno * epa.el (epa--key-widget-value-create): Allow empty user IDs. diff --git a/epg.el b/epg.el index 114c83b..1ae12b5 100644 --- a/epg.el +++ b/epg.el @@ -326,18 +326,25 @@ This function is for internal use only." (signal 'wrong-type-argument (list 'epg-context-p context))) (aset (cdr context) 6 compress-algorithm)) -(defun epg-context-set-passphrase-callback (context - passphrase-callback) - "Set the function used to query passphrase." +(defun epg-context-set-passphrase-callback (context passphrase-callback + &optional handback) + "Set the function used to query passphrase. +If optional argument HANDBACK is specified, it is passed to CALLBACK." (unless (eq (car-safe context) 'epg-context) (signal 'wrong-type-argument (list 'epg-context-p context))) - (aset (cdr context) 7 passphrase-callback)) - -(defun epg-context-set-progress-callback (context progress-callback) - "Set the function which handles progress update." + (aset (cdr context) 7 (if handback + (cons passphrase-callback handback) + passphrase-callback))) + +(defun epg-context-set-progress-callback (context progress-callback + &optional handback) + "Set the function which handles progress update. +If optional argument HANDBACK is specified, it is passed to 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 handback + (cons progress-callback handback) + progress-callback))) (defun epg-context-set-signers (context signers) "Set the list of key-id for singning."