(if (looking-at "\\[GNUPG:] \\([A-Z_]+\\) ?\\(.*\\)")
(let* ((status (match-string 1))
(string (match-string 2))
- (symbol (intern-soft (concat "epg--status-"
- status))))
+ (symbol (if (eq (epg-context-operation epg-context)
+ 'edit-key)
+ #'epg--edit-key-callback
+ (intern-soft (concat "epg--status-"
+ status)))))
(if (member status epg-pending-status-list)
(setq epg-pending-status-list nil))
(if (and symbol
(defalias 'epg--decode-coding-string 'decode-coding-string)
(defalias 'epg--decode-coding-string 'identity)))
+(defun epg--edit-key-callback (context string)
+ (let ((callback (epg-context-edit-key-callback context)))
+ (funcall (car callback) (cdr callback))))
+
(defun epg--status-USERID_HINT (context string)
(if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string)
(let* ((key-id (match-string 1 string))
(epg-reset context)))
;;;###autoload
-(defun epg-start-edit-key (context key &optional callback handback output)
+(defun epg-start-edit-key (context key callback &optional handback)
"Initiate an edit key operation.
If you use this function, you will need to wait for the completion of
`epg-sign-keys' instead."
(epg-context-set-operation context 'edit-key)
(epg-context-set-result context nil)
- (epg-context-set-edit-key-callback context callback (cons handback output))
+ (epg-context-set-edit-key-callback context callback handback)
(epg--start context (list "--edit-key"
(epg-sub-key-id (car epg-key-sub-key-list key)))))
;;;###autoload
-(defun epg-edit-key (context key &optional callback handback output)
+(defun epg-edit-key (context key callback &optional handback)
"Process the KEY interactively, using the edit CALLBACK with the HANDBACK.
The CALLBACK is invoked for every status and command request from
-the crypto engine. The output of the crypto engine is written to
-the data object OUTPUT."
+the crypto engine."
(unwind-protect
(progn
- (epg-start-edit-key context key callback handback output)
+ (epg-start-edit-key context key callback handback)
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
(error "Edit key failed: %S"