X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=epg.el;h=de72571a6423696f10a5b6b2fd10cb132bc0411c;hb=95ff40c9179c88308fe96e1adb0ef220b67f265c;hp=da830fd4e43f0075d314e0c7acdac067e02c9fe6;hpb=4096aa3c6b7ea99b15ad6ad4165b1ca84dbab395;p=elisp%2Fepg.git diff --git a/epg.el b/epg.el index da830fd..de72571 100644 --- a/epg.el +++ b/epg.el @@ -84,6 +84,8 @@ This is used by `epg-list-keys'.") (user-id "[^:]+")) "The schema of keylisting output whose type is \"uid\". This is used by `epg-list-keys'.") + +(defvar epg-prompt-alist nil) (defun epg-make-context (&optional protocol armor textmode include-certs) "Return a context object." @@ -363,6 +365,17 @@ This function is for internal use only." (if string (fillarray string 0)))))) +(defun epg-status-GET_BOOL (process string) + (let ((entry (assoc string epg-prompt-alist))) + (if (y-or-n-p (if entry (cdr entry) (concat string "? "))) + (process-send-string process "y\n") + (process-send-string process "n\n")))) + +(defun epg-status-GET_LINE (process string) + (let* ((entry (assoc string epg-prompt-alist)) + (string (read-string (if entry (cdr entry) (concat string ": "))))) + (process-send-string process (concat string "\n"))))) + (defun epg-status-GOODSIG (process string) (if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string) (epg-context-set-result-for