From: ueno Date: Sat, 16 Aug 2003 05:31:48 +0000 (+0000) Subject: * Don't autoload S/MIME stuff. X-Git-Tag: emiko-1_14-epg-branchpoint~35 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f375b2eb1d4b0162128281c1dda94c0448ce3ec1;p=elisp%2Fsemi.git * Don't autoload S/MIME stuff. * pgg-def.el (pgg-overriding-user-id): New variable. * pgg.el (pgg-universal-user-id-argument): New command. * pgg-gpg.el (pgg-scheme-encrypt-region): Prefer pgg-overriding-user-id to pgg-gpg-user-id. (pgg-scheme-decrypt-region): Ditto. (pgg-scheme-sign-region): Ditto. (pgg-scheme-insert-key): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 28ff439..3923809 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-08-16 Daiki Ueno + + * Don't autoload S/MIME stuff. + + * pgg-def.el (pgg-overriding-user-id): New variable. + * pgg.el (pgg-universal-user-id-argument): New command. + * pgg-gpg.el (pgg-scheme-encrypt-region): Prefer + pgg-overriding-user-id to pgg-gpg-user-id. + (pgg-scheme-decrypt-region): Ditto. + (pgg-scheme-sign-region): Ditto. + (pgg-scheme-insert-key): Ditto. + 2003-05-22 Daiki Ueno * mime-play.el (mime-activate-mailcap-method): Undo the last change. diff --git a/mime-pgp.el b/mime-pgp.el index 3e39afa..fc1b1db 100644 --- a/mime-pgp.el +++ b/mime-pgp.el @@ -59,21 +59,6 @@ "PGP verification of current region." t) (autoload 'pgg-snarf-keys-region "pgg" "Snarf PGP public keys in current region." t) -(autoload 'smime-decrypt-buffer "smime" - "S/MIME decryption of current region.") -(autoload 'smime-verify-buffer "smime" - "Verify integrity of S/MIME message in BUFFER.") -(autoload 'smime-noverify-buffer "smime" - "Verify integrity of S/MIME message in BUFFER.") -(autoload 'smime-pkcs7-region "smime" - "Convert S/MIME message into a PKCS7 message.") -(autoload 'smime-pkcs7-certificates-region "smime" - "Extract any certificates enclosed in PKCS7 message.") -(autoload 'smime-pkcs7-email-region "smime" - "Get email addresses contained in certificate.") -(defvar smime-details-buffer) -(defvar smime-CA-file) -(defvar smime-CA-directory) ;;; @ Internal method for multipart/signed ;;; diff --git a/pgg-def.el b/pgg-def.el index 7630f95..3a5508e 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -43,6 +43,10 @@ :group 'pgg :type 'string) +(defvar pgg-overriding-user-id nil + "User ID temporally bound during the command consequent upon +`pgg-universal-user-id-argument'.") + (defcustom pgg-default-keyserver-address "wwwkeys.pgp.net" "Host name of keyserver." :group 'pgg diff --git a/pgg-gpg.el b/pgg-gpg.el index 873cff4..5ba57c4 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -136,7 +136,8 @@ (luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-gpg) start end recipients) - (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (let* ((user-id (or pgg-overriding-user-id pgg-gpg-user-id + pgg-default-user-id)) (args `("--batch" "--armor" "--always-trust" "--encrypt" ,@(if recipients @@ -145,18 +146,19 @@ (list "--remote-user" rcpt)) (append recipients (if pgg-encrypt-for-me - (list pgg-gpg-user-id))))))))) + (list user-id))))))))) (pgg-as-lbt start end 'CRLF (pgg-gpg-process-region start end nil pgg-gpg-program args)) (pgg-process-when-success))) (luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-gpg) start end) - (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (let* ((user-id (or pgg-overriding-user-id pgg-gpg-user-id + pgg-default-user-id)) (passphrase (pgg-read-passphrase (format "GnuPG passphrase for %s: " pgg-gpg-user-id) - (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'encrypt))) + (pgg-scheme-lookup-key scheme user-id 'encrypt))) (args '("--batch" "--decrypt"))) (pgg-gpg-process-region start end passphrase pgg-gpg-program args) (with-current-buffer pgg-errors-buffer @@ -166,15 +168,16 @@ (luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-gpg) start end &optional cleartext) - (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (let* ((user-id (or pgg-overriding-user-id pgg-gpg-user-id + pgg-default-user-id)) (passphrase (pgg-read-passphrase - (format "GnuPG passphrase for %s: " pgg-gpg-user-id) - (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'sign))) + (format "GnuPG passphrase for %s: " user-id) + (pgg-scheme-lookup-key scheme user-id 'sign))) (args (list (if cleartext "--clearsign" "--detach-sign") "--armor" "--batch" "--verbose" - "--local-user" pgg-gpg-user-id)) + "--local-user" user-id)) (inhibit-read-only t) buffer-read-only) (pgg-as-lbt start end 'CRLF @@ -202,9 +205,9 @@ (insert-buffer-substring pgg-errors-buffer))))) (luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-gpg)) - (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) - (args (list "--batch" "--export" "--armor" - pgg-gpg-user-id))) + (let* ((user-id (or pgg-overriding-user-id pgg-gpg-user-id + pgg-default-user-id)) + (args (list "--batch" "--export" "--armor" user-id))) (pgg-gpg-process-region (point)(point) nil pgg-gpg-program args) (insert-buffer-substring pgg-output-buffer))) diff --git a/pgg.el b/pgg.el index 2b17b3e..1a25d91 100644 --- a/pgg.el +++ b/pgg.el @@ -416,6 +416,15 @@ signer's public key from `pgg-default-keyserver-address'." (insert-buffer-substring pgg-output-buffer) (pgg-snarf-keys-region (point-min)(point-max))))))) +;;;###autoload +(defun pgg-universal-user-id-argument () + (interactive) + (let* ((pgg-overriding-user-id (read-string "User ID: ")) + (command (key-binding (read-key-sequence + (format "Command to execute on \"%s\":" + pgg-overriding-user-id))))) + (message "") + (call-interactively command))) (provide 'pgg)