Function: epg-wait-for-completion

epg-wait-for-completion is a byte-compiled function defined in epg.el.gz.

Signature

(epg-wait-for-completion CONTEXT)

Documentation

Wait until the epg-gpg-program process completes.

Source Code

;; Defined in /usr/src/emacs/lisp/epg.el.gz
(defun epg-wait-for-completion (context)
  "Wait until the `epg-gpg-program' process completes."
  (while (eq (process-status (epg-context-process context)) 'run)
    (accept-process-output (epg-context-process context) 1))
  ;; This line is needed to run the process-filter right now.
  (sleep-for 0.1)
  ;; Restore Emacs frame on text terminal, when pinentry-curses has terminated.
  (if (with-current-buffer (process-buffer (epg-context-process context))
	(and epg-agent-file
	     (time-less-p epg-agent-mtime
			  (or (file-attribute-modification-time
			       (file-attributes epg-agent-file))
			      0))))
      (redraw-frame))
  (epg-context-set-result-for
   context 'error
   (nreverse (epg-context-result-for context 'error)))
  (setf (epg-context-error-output context)
	(with-current-buffer (epg-context-error-buffer context)
	  (buffer-string))))