From 38402bbdac8ee47381001665a2fc0d1fe5b6cba1 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 11 Jun 1998 15:14:35 +0000 Subject: [PATCH] Abolish variable `mime-edit-signing-type' and `mime-edit-encrypting-type'. (mime-edit-process-multipart-1): Separate "signed" to "pgp-signed" and "kazu-signed"; separate "encrypted" to "pgp-encrypted" and "kazu-encrypted"; (mime-edit-enclose-signed-region): Renamed from `mime-edit-enclose-pgp-signed-region'. (mime-edit-enclose-pgp-encrypted-region): Renamed from `mime-edit-enclose-encrypted-region'. (mime-edit-enclose-kazu-signed-region): New function. (mime-edit-enclose-kazu-encrypted-region): New function. (mime-edit-set-sign): Don't refer `mime-edit-signing-type'. (mime-edit-set-encrypt): Don't refer `mime-edit-encrypting-type'. --- mime-edit.el | 122 +++++++++++++++++++++++++++------------------------------- 1 file changed, 56 insertions(+), 66 deletions(-) diff --git a/mime-edit.el b/mime-edit.el index 5da8260..4924c8d 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -517,16 +517,6 @@ If it is not specified for a major-mode, (defvar mime-edit-news-reply-mode-server-running nil) -;;; @@ about PGP -;;; - -(defvar mime-edit-signing-type 'pgp-mime - "*PGP signing type (pgp-mime, pgp-kazu or nil).") - -(defvar mime-edit-encrypting-type 'pgp-mime - "*PGP encrypting type (pgp-mime, pgp-kazu or nil).") - - ;;; @@ about tag ;;; @@ -661,9 +651,9 @@ Tspecials means any character that matches with it in header must be quoted.") (define-key mime-edit-mode-enclosure-map "\C-d" 'mime-edit-enclose-digest-region) (define-key mime-edit-mode-enclosure-map - "\C-s" 'mime-edit-enclose-signed-region) + "\C-s" 'mime-edit-enclose-pgp-signed-region) (define-key mime-edit-mode-enclosure-map - "\C-e" 'mime-edit-enclose-encrypted-region) + "\C-e" 'mime-edit-enclose-pgp-encrypted-region) (define-key mime-edit-mode-enclosure-map "\C-q" 'mime-edit-enclose-quote-region) @@ -691,8 +681,8 @@ Tspecials means any character that matches with it in header must be quoted.") (parallel "Enclose as parallel" mime-edit-enclose-parallel-region) (mixed "Enclose as serial" mime-edit-enclose-mixed-region) (digest "Enclose as digest" mime-edit-enclose-digest-region) - (signed "Enclose as signed" mime-edit-enclose-signed-region) - (encrypted "Enclose as encrypted" mime-edit-enclose-encrypted-region) + (signed "Enclose as signed" mime-edit-enclose-pgp-signed-region) + (encrypted "Enclose as encrypted" mime-edit-enclose-pgp-encrypted-region) (quote "Verbatim region" mime-edit-enclose-quote-region) (key "Insert Public Key" mime-edit-insert-key) (split "About split" mime-edit-set-split) @@ -810,24 +800,27 @@ Following commands are available in addition to major mode commands: \\[mime-edit-insert-tag] insert a new MIME tag. \[make enclosure (maybe multipart)\] -\\[mime-edit-enclose-alternative-region] enclose as multipart/alternative. -\\[mime-edit-enclose-parallel-region] enclose as multipart/parallel. -\\[mime-edit-enclose-mixed-region] enclose as multipart/mixed. -\\[mime-edit-enclose-digest-region] enclose as multipart/digest. -\\[mime-edit-enclose-signed-region] enclose as PGP signed. -\\[mime-edit-enclose-encrypted-region] enclose as PGP encrypted. -\\[mime-edit-enclose-quote-region] enclose as verbose mode (to avoid to expand tags) +\\[mime-edit-enclose-alternative-region] enclose as multipart/alternative. +\\[mime-edit-enclose-parallel-region] enclose as multipart/parallel. +\\[mime-edit-enclose-mixed-region] enclose as multipart/mixed. +\\[mime-edit-enclose-digest-region] enclose as multipart/digest. +\\[mime-edit-enclose-pgp-signed-region] enclose as PGP signed. +\\[mime-edit-enclose-pgp-encrypted-region] enclose as PGP encrypted. +\\[mime-edit-enclose-quote-region] enclose as verbose mode + (to avoid to expand tags) \[other commands\] \\[mime-edit-set-transfer-level-7bit] set transfer-level as 7. \\[mime-edit-set-transfer-level-8bit] set transfer-level as 8. -\\[mime-edit-set-split] set message splitting mode. -\\[mime-edit-set-sign] set PGP-sign mode. -\\[mime-edit-set-encrypt] set PGP-encryption mode. -\\[mime-edit-preview-message] preview editing MIME message. -\\[mime-edit-exit] exit and translate into a MIME compliant message. -\\[mime-edit-help] show this help. -\\[mime-edit-maybe-translate] exit and translate if in MIME mode, then split. +\\[mime-edit-set-split] set message splitting mode. +\\[mime-edit-set-sign] set PGP-sign mode. +\\[mime-edit-set-encrypt] set PGP-encryption mode. +\\[mime-edit-preview-message] preview editing MIME message. +\\[mime-edit-exit] exit and translate into a MIME + compliant message. +\\[mime-edit-help] show this help. +\\[mime-edit-maybe-translate] exit and translate if in MIME mode, + then split. Additional commands are available in some major modes: C-c C-c exit, translate and run the original command. @@ -1604,21 +1597,18 @@ Parameter must be '(PROMPT CHOICE1 (CHOISE2 ...))." (cond ((string-equal type "quote") (mime-edit-enquote-region bb eb) ) - ((string-equal type "signed") - (cond ((eq mime-edit-signing-type 'pgp-mime) - (mime-edit-sign-pgp-mime bb eb boundary) - ) - ((eq mime-edit-signing-type 'pgp-kazu) - (mime-edit-sign-pgp-kazu bb eb boundary) - )) + ((string-equal type "pgp-signed") + (mime-edit-sign-pgp-mime bb eb boundary) + ) + ((string-equal type "pgp-encrypted") + (mime-edit-encrypt-pgp-mime bb eb boundary) + ) + ((string-equal type "kazu-signed") + (mime-edit-sign-pgp-kazu bb eb boundary) + ) + ((string-equal type "kazu-encrypted") + (mime-edit-encrypt-pgp-kazu bb eb boundary) ) - ((string-equal type "encrypted") - (cond ((eq mime-edit-encrypting-type 'pgp-mime) - (mime-edit-encrypt-pgp-mime bb eb boundary) - ) - ((eq mime-edit-encrypting-type 'pgp-kazu) - (mime-edit-encrypt-pgp-kazu bb eb boundary) - ))) (t (setq boundary (nth 2 (mime-edit-translate-region bb eb @@ -2199,19 +2189,25 @@ and insert data encoded as ENCODING." (mime-edit-enclose-region-internal 'alternative beg end) ) -(defun mime-edit-enclose-signed-region (beg end) +(defun mime-edit-enclose-pgp-signed-region (beg end) (interactive "*r") - (if mime-edit-signing-type - (mime-edit-enclose-region-internal 'signed beg end) - (message "Please specify signing type.") - )) + (mime-edit-enclose-region-internal 'pgp-signed beg end) + ) -(defun mime-edit-enclose-encrypted-region (beg end) +(defun mime-edit-enclose-pgp-encrypted-region (beg end) (interactive "*r") - (if mime-edit-signing-type - (mime-edit-enclose-region-internal 'encrypted beg end) - (message "Please specify encrypting type.") - )) + (mime-edit-enclose-region-internal 'pgp-encrypted beg end) + ) + +(defun mime-edit-enclose-kazu-signed-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'kazu-signed beg end) + ) + +(defun mime-edit-enclose-kazu-encrypted-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'kazu-encrypted beg end) + ) (defun mime-edit-insert-key (&optional arg) "Insert a pgp public key." @@ -2277,12 +2273,9 @@ Optional TRANSFER-LEVEL is a number of transfer-level, 7 or 8." (y-or-n-p "Do you want to sign? ") )) (if arg - (if mime-edit-signing-type - (progn - (setq mime-edit-pgp-processing 'sign) - (message "This message will be signed.") - ) - (message "Please specify signing type.") + (progn + (setq mime-edit-pgp-processing 'sign) + (message "This message will be signed.") ) (if (eq mime-edit-pgp-processing 'sign) (setq mime-edit-pgp-processing nil) @@ -2296,12 +2289,9 @@ Optional TRANSFER-LEVEL is a number of transfer-level, 7 or 8." (y-or-n-p "Do you want to encrypt? ") )) (if arg - (if mime-edit-encrypting-type - (progn - (setq mime-edit-pgp-processing 'encrypt) - (message "This message will be encrypt.") - ) - (message "Please specify encrypting type.") + (progn + (setq mime-edit-pgp-processing 'encrypt) + (message "This message will be encrypt.") ) (if (eq mime-edit-pgp-processing 'encrypt) (setq mime-edit-pgp-processing nil) @@ -2319,10 +2309,10 @@ Optional TRANSFER-LEVEL is a number of transfer-level, 7 or 8." ) (if beg (cond ((eq mime-edit-pgp-processing 'sign) - (mime-edit-enclose-signed-region beg end) + (mime-edit-enclose-pgp-signed-region beg end) ) ((eq mime-edit-pgp-processing 'encrypt) - (mime-edit-enclose-encrypted-region beg end) + (mime-edit-enclose-pgp-encrypted-region beg end) )) ))) -- 1.7.10.4