From a8ba999777d20d591129631e725d07ea4a2b0183 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 1 Feb 2000 04:03:25 +0000 Subject: [PATCH] * pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el (pgg-scheme-lookup-key): Rename from `pgg-scheme-lookup-key-string'. (pgg-scheme-decrypt-region): Use `pgg-scheme-lookup-key'. (pgg-scheme-sign-region): Ditto. * pgg-gpg.el (pgg-scheme-lookup-key-string): Generate *PGG-output* buffer if it does not exist. --- pgg-gpg.el | 12 +++++------- pgg-pgp.el | 8 +++----- pgg-pgp5.el | 8 +++----- pgg.el | 9 ++++----- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/pgg-gpg.el b/pgg-gpg.el index 676335e..2bcb3c7 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -128,12 +128,12 @@ (if (and process (eq 'run (process-status process))) (interrupt-process process))))) -(luna-define-method pgg-scheme-lookup-key-string ((scheme pgg-scheme-gpg) - string &optional type) +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-gpg) + string &optional type) (let ((args (list "--with-colons" "--no-greeting" "--batch" (if type "--list-secret-keys" "--list-keys") string))) - (with-current-buffer pgg-output-buffer + (with-current-buffer (get-buffer-create pgg-output-buffer) (buffer-disable-undo) (erase-buffer) (apply #'call-process pgg-gpg-program nil t nil args) @@ -170,8 +170,7 @@ (passphrase (pgg-read-passphrase (format "GnuPG passphrase for %s: " pgg-gpg-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-gpg-user-id 'encrypt))) + (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'encrypt))) (args '("--batch" "--decrypt"))) (pgg-gpg-process-region start end passphrase pgg-gpg-program args) (pgg-process-when-success nil))) @@ -182,8 +181,7 @@ (passphrase (pgg-read-passphrase (format "GnuPG passphrase for %s: " pgg-gpg-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-gpg-user-id 'sign))) + (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'sign))) (args (list (if cleartext "--clearsign" "--detach-sign") "--armor" "--batch" "--verbose" diff --git a/pgg-pgp.el b/pgg-pgp.el index 083097f..e7e2ee7 100644 --- a/pgg-pgp.el +++ b/pgg-pgp.el @@ -116,7 +116,7 @@ (if (and process (eq 'run (process-status process))) (interrupt-process process))))) -(luna-define-method pgg-scheme-lookup-key-string ((scheme pgg-scheme-pgp) +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp) string &optional type) (let ((args (list "+batchmode" "+language=en" "-kv" string))) (with-current-buffer (get-buffer-create pgg-output-buffer) @@ -154,8 +154,7 @@ (passphrase (pgg-read-passphrase (format "PGP passphrase for %s: " pgg-pgp-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-pgp-user-id 'encrypt))) + (pgg-scheme-lookup-key scheme pgg-pgp-user-id 'encrypt))) (args '("+verbose=1" "+batchmode" "+language=us" "-f"))) (pgg-pgp-process-region start end passphrase pgg-pgp-program args) @@ -167,8 +166,7 @@ (passphrase (pgg-read-passphrase (format "PGP passphrase for %s: " pgg-pgp-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-pgp-user-id 'sign))) + (pgg-scheme-lookup-key scheme pgg-pgp-user-id 'sign))) (args (list (if clearsign "-fast" "-fbast") "+verbose=1" "+language=us" "+batchmode" diff --git a/pgg-pgp5.el b/pgg-pgp5.el index 8ad30a2..2b26a3f 100644 --- a/pgg-pgp5.el +++ b/pgg-pgp5.el @@ -131,7 +131,7 @@ (if (and process (eq 'run (process-status process))) (interrupt-process process))))) -(luna-define-method pgg-scheme-lookup-key-string ((scheme pgg-scheme-pgp5) +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp5) string &optional type) (let ((args (list "+language=en" "-l" string))) (with-current-buffer (get-buffer-create pgg-output-buffer) @@ -167,8 +167,7 @@ (passphrase (pgg-read-passphrase (format "PGP passphrase for %s: " pgg-pgp5-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-pgp5-user-id 'encrypt))) + (pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'encrypt))) (args '("+verbose=1" "+batchmode=1" "+language=us" "-f"))) (pgg-pgp5-process-region start end passphrase pgg-pgp5-pgpv-program args) @@ -180,8 +179,7 @@ (passphrase (pgg-read-passphrase (format "PGP passphrase for %s: " pgg-pgp5-user-id) - (luna-send scheme 'lookup-key-string - scheme pgg-pgp5-user-id 'sign))) + (pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'sign))) (args (list (if clearsign "-fat" "-fbat") "+verbose=1" "+language=us" "+batchmode=1" diff --git a/pgg.el b/pgg.el index 4557a6d..06b4375 100644 --- a/pgg.el +++ b/pgg.el @@ -113,8 +113,7 @@ (luna-define-internal-accessors 'pgg-scheme)) -(luna-define-generic pgg-scheme-lookup-key-string - (scheme string &optional type) +(luna-define-generic pgg-scheme-lookup-key (scheme string &optional type) "Search keys associated with STRING") (luna-define-generic pgg-scheme-encrypt-region (scheme start end recipients) @@ -334,7 +333,7 @@ signer's public key from `pgg-default-keyserver-address'." (and (stringp key) (setq key (concat "0x" (pgg-truncate-key-identifier key))) (null (let ((pgg-scheme scheme)) - (pgg-lookup-key-string key))) + (pgg-lookup-key key))) (or fetch (interactive-p)) (y-or-n-p (format "Key %s not found; attempt to fetch? " key)) (setq keyserver @@ -368,9 +367,9 @@ signer's public key from `pgg-default-keyserver-address'." (pgg-save-coding-system start end (pgg-scheme-snarf-keys-region entity start end)))) -(defun pgg-lookup-key-string (string &optional type) +(defun pgg-lookup-key (string &optional type) (let ((entity (pgg-make-scheme (or pgg-scheme pgg-default-scheme)))) - (pgg-scheme-lookup-key-string entity string type))) + (pgg-scheme-lookup-key entity string type))) (defvar pgg-insert-url-function (function pgg-insert-url-with-w3)) -- 1.7.10.4