From: ueno Date: Sat, 29 Apr 2006 21:51:21 +0000 (+0000) Subject: Added docstring. X-Git-Tag: epg-0_0_2~85 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10640260563d9c57757264dfb59743d084892433;p=elisp%2Fepg.git Added docstring. --- diff --git a/epg.el b/epg.el index bcf3675..831df9a 100644 --- a/epg.el +++ b/epg.el @@ -567,9 +567,11 @@ This function is for internal use only." (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 @@ -577,6 +579,7 @@ This function is for internal use only." (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 @@ -605,6 +608,7 @@ This function is for internal use only." "")))) (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) @@ -687,6 +691,7 @@ This function is for internal use only." (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)) @@ -698,29 +703,32 @@ This function is for internal use only." (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))))