* (mime-pgp-parse-verify-error): Use `with-current-buffer' instead of
[elisp/semi.git] / mime-edit.el
index b0555cb..236daf0 100644 (file)
 (require 'sendmail)
 (require 'mail-utils)
 (require 'mel)
+(require 'semi-def)
 (require 'mime-view)
 (require 'signature)
 (require 'alist)
 (require 'invisible)
 
-;; Avoid byte-compile warning.
-(defvar mc-default-scheme)
-
 
 ;;; @ version
 ;;;
@@ -1800,7 +1798,10 @@ Parameter must be '(PROMPT CHOICE1 (CHOISE2 ...))."
                (mime-edit-translate-region beg end boundary))
               (ctype    (car ret))
               (encoding (nth 1 ret))
-              pgp-boundary)
+              (pgp-boundary (concat (if (eq 'gpg pgp-version)
+                                        "gpg-"
+                                      "pgp-")
+                                    boundary)))
          (goto-char beg)
          (insert header)
          (insert (format "Content-Type: %s\n" ctype))
@@ -1812,12 +1813,6 @@ Parameter must be '(PROMPT CHOICE1 (CHOISE2 ...))."
                       recipients (point-min) (point-max) from)
              (throw 'mime-edit-error 'pgp-error)
              )
-         (setq pgp-boundary
-               (format "%s-%s"
-                       (if (eq 'mc-scheme-gpg mc-default-scheme)
-                           "gpg"
-                         "pgp")
-                       boundary))
          (goto-char beg)
          (insert (format "--[[multipart/encrypted;
  boundary=\"%s\";
@@ -2177,8 +2172,7 @@ Content-Transfer-Encoding: 7bit
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (delete-region (match-beginning 0)
-                    (progn (forward-line 1) (point)))
-      )))
+                    (1+ (std11-field-end))))))
 
 \f
 ;;;
@@ -2558,6 +2552,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
         (buf-name (buffer-name))
         (temp-buf-name (concat "*temp-article:" buf-name "*"))
         (buf (get-buffer temp-buf-name))
+        (pgp-processing mime-edit-pgp-processing)
         )
     (if buf
        (progn
@@ -2573,6 +2568,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
     (setq mail-header-separator separator)
     (make-local-variable 'mime-edit-buffer)
     (setq mime-edit-buffer the-buf)
+    (setq mime-edit-pgp-processing pgp-processing)
 
     (run-hooks 'mime-edit-translate-hook)
     (mime-edit-translate-buffer)
@@ -2713,9 +2709,15 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
                              encoding nil)
                        )))))))
     (if (or encoded (not not-decode-text))
-       (decode-mime-charset-region (point-min)(point-max)
-                                   (or charset default-mime-charset))
-      )
+       (progn
+         (save-excursion
+           (goto-char (point-min))
+           (while (re-search-forward "\r\n" nil t)
+             (replace-match "\n")
+             ))
+         (decode-mime-charset-region (point-min)(point-max)
+                                     (or charset default-mime-charset))
+         ))
     (let ((he (if (re-search-forward "^$" nil t)
                  (match-end 0)
                (point-min)