From 6e1ac38c1e5f8eedb023761386a06611fd3f2dad Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 2 Sep 2006 01:16:05 +0000 Subject: [PATCH] * epg.el (epg-check-configuration): New function. --- ChangeLog | 2 ++ epg.el | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7390bb0..cdc2b4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-09-02 Daiki Ueno + * epg.el (epg-check-configuration): New function. + * pgg-epg.el (pgg-epg-lookup-key): New function. 2006-07-29 Daiki Ueno diff --git a/epg.el b/epg.el index bcec36f..14c6c53 100644 --- a/epg.el +++ b/epg.el @@ -1305,6 +1305,7 @@ This function is for internal use only." handback) (message "%s: %d%%/%d%%" what current total)) +;;;###autoload (defun epg-configuration () "Return a list of internal configuration parameters of `epg-gpg-program'." (let (config type) @@ -1325,6 +1326,26 @@ This function is for internal use only." config)))) config)) +;;;###autoload +(defun epg-check-configuration (configuration) + "Verify that CONFIGURATION is sufficient." + (let ((entry (assq 'version configuration)) + major minor teeny) + (unless (and entry + (stringp (cdr entry)) + (string-match "\\`\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" + (cdr entry))) + (error "Undetermined version: %S" entry)) + (setq major (string-to-number (match-string 1 (cdr entry))) + minor (string-to-number (match-string 2 (cdr entry))) + teeny (string-to-number (match-string 3 (cdr entry)))) + (unless (or (> major 1) + (and (= major 1) + (or (> minor 4) + (and (= minor 4) + (>= teeny 3))))) + (error "Unsupported version: %s" version)))) + (defun epg--list-keys-1 (context name mode) (let ((args (append (list "--with-colons" "--no-greeting" "--batch" "--with-fingerprint" -- 1.7.10.4