(aset (cdr user-id) 2 signature-list))
(defun epg-context-result-for (context name)
+ "Return the result of CONTEXT associated with NAME."
(cdr (assq name (epg-context-result context))))
(defun epg-context-set-result-for (context name value)
+ "Set the result of CONTEXT associated with NAME to VALUE."
(let* ((result (epg-context-result context))
(entry (assq name result)))
(if entry
(epg-context-set-result context (cons (cons name value) result)))))
(defun epg-signature-to-string (signature)
+ "Convert SIGNATURE to a human readable string."
(let ((user-id (cdr (assoc (epg-signature-key-id signature)
epg-user-id-alist))))
(concat
""))))
(defun epg-verify-result-to-string (verify-result)
+ "Convert VERIFY-RESULT to a human readable string."
(mapconcat #'epg-signature-to-string verify-result "\n"))
(defun epg-start (context args)
(setq epg-read-point (point)))))
(defun epg-read-output (context)
+ "Read the output file CONTEXT and return the content as a string."
(with-temp-buffer
(if (fboundp 'set-buffer-multibyte)
(set-buffer-multibyte nil))
(buffer-string)))))
(defun epg-wait-for-status (context status-list)
+ "Wait until one of elements in STATUS-LIST arrives."
(with-current-buffer (process-buffer (epg-context-process context))
(setq epg-pending-status-list status-list)
(while (and (eq (process-status (epg-context-process context)) 'run)
epg-pending-status-list)
- (accept-process-output (epg-context-process context) 1))))
+ (accept-process-output (epg-context-process context) 0 1))))
(defun epg-wait-for-completion (context)
+ "Wait until the `epg-gpg-program' process completes."
(while (eq (process-status (epg-context-process context)) 'run)
- ;; We can't use accept-process-output instead of sit-for here
- ;; because it may cause an interrupt during the sentinel execution.
- (sit-for 0.1)))
+ (accept-process-output (epg-context-process context) 0 1)))
(defun epg-flush (context)
+ "Flush the input to the `epg-gpg-program' process."
(if (eq (process-status (epg-context-process context)) 'run)
(process-send-eof (epg-context-process context))))
(defun epg-reset (context)
+ "Reset the CONTEXT."
(if (and (epg-context-process context)
(buffer-live-p (process-buffer (epg-context-process context))))
(kill-buffer (process-buffer (epg-context-process context))))
(epg-context-set-process context nil))
(defun epg-delete-output-file (context)
+ "Delete the output file of CONTEXT."
(if (and (epg-context-output-file context)
(file-exists-p (epg-context-output-file context)))
(delete-file (epg-context-output-file context))))