From 78212be7c3b29185ab44bf2df8532218f765a76c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 14 Apr 1999 23:21:09 +0000 Subject: [PATCH] * mime-edit.el (mime-edit-insert-key): Prompt for user id if prefix arg is given. * mime-mc.el (mime-mc-insert-public-key): Fix bug - referring to undefined variable. --- ChangeLog | 8 ++++++++ mime-edit.el | 10 ++++++---- mime-mc.el | 36 ++++++++++-------------------------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05f5281..76f38a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 1999-04-14 Katsumi Yamaoka + * mime-edit.el (mime-edit-insert-key): Prompt for user id if prefix + arg is given. + + * mime-mc.el (mime-mc-insert-public-key): Fix bug - referring to + undefined variable. + +1999-04-14 Katsumi Yamaoka + * mime-ui-en.texi, mime-ui-ja.texi: Sync up with .sgml files. * mime-ui-en.sgml, mime-ui-ja.sgml: Modify a description for simplified `pgp-function-alist'. diff --git a/mime-edit.el b/mime-edit.el index 9919b5f..5fe5b75 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -2304,12 +2304,14 @@ and insert data encoded as ENCODING." (mime-edit-enclose-region-internal 'kazu-encrypted beg end) ) -(defun mime-edit-insert-key (&optional arg) - "Insert a pgp public key." - (interactive "P") +(defun mime-edit-insert-key (&optional userid) + "Insert a pgp public key. With prefix arg, prompts for user id to use." + (interactive (if current-prefix-arg + (list (read-string "User ID: ")) + )) (mime-edit-insert-tag "application" "pgp-keys") (mime-edit-define-encoding "7bit") - (funcall (pgp-function 'insert-key)) + (funcall (pgp-function 'insert-key) userid) ) diff --git a/mime-mc.el b/mime-mc.el index abcd717..e600bd5 100644 --- a/mime-mc.el +++ b/mime-mc.el @@ -230,33 +230,17 @@ request for the key." ) (defun mime-mc-insert-public-key (&optional userid) - "Insert your public key at point. With one prefix arg, prompts for -user id to use." - (let ((not-loaded (not (fboundp (intern (format "mc-%s-insert-public-key" - pgp-version))))) - (comment (mime-mc-comment)) + "Insert your public key at point." + (or (fboundp (intern (format "mc-%s-insert-public-key" pgp-version))) + (load (concat "mc-" (cdr (assq pgp-version '((gpg . "gpg") + (pgp50 . "pgp5") + (pgp . "pgp"))))))) + (let ((comment (mime-mc-comment)) + (mc-comment (intern (format "mc-%s-comment" pgp-version))) (scheme (intern (format "mc-scheme-%s" pgp-version)))) - (cond ((eq 'gpg pgp-version) - (if not-loaded - (load "mc-gpg") - ) - (let ((mc-gpg-comment (if comment "DUMMY"))) - (mc-insert-public-key userid scheme)) - ) - ((eq 'pgp50 pgp-version) - (if not-loaded - (load "mc-pgp5") - ) - (let ((mc-pgp50-comment (if comment "DUMMY"))) - (mc-insert-public-key userid scheme)) - ) - (t - (if not-loaded - (load "mc-pgp") - ) - (let ((mc-pgp-comment (if comment "DUMMY"))) - (mc-insert-public-key userid scheme)) - )) + (eval (` (let (((, mc-comment) (if (, comment) "DUMMY"))) + (mc-insert-public-key (, userid) (quote (, scheme))) + ))) (if comment (mime-mc-replace-comment-field comment) ))) -- 1.7.10.4