* pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el
authorueno <ueno>
Tue, 1 Feb 2000 04:03:25 +0000 (04:03 +0000)
committerueno <ueno>
Tue, 1 Feb 2000 04:03:25 +0000 (04:03 +0000)
(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
pgg-pgp.el
pgg-pgp5.el
pgg.el

index 676335e..2bcb3c7 100644 (file)
       (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)
         (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)))
         (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" 
index 083097f..e7e2ee7 100644 (file)
       (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)
         (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)
         (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"
index 8ad30a2..2b26a3f 100644 (file)
       (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)
         (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)
         (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 (file)
--- a/pgg.el
+++ b/pgg.el
 
   (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))