* (mime-pgp-parse-verify-error): Use `with-current-buffer' instead of
[elisp/semi.git] / mime-edit.el
index 89b4655..236daf0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mime-edit.el --- Simple MIME Composer for GNU Emacs
 
-;; Copyright (C) 1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1993,94,95,96,97,98,99 Free Software Foundation, Inc.
 
 ;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
 ;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
 (require 'sendmail)
 (require 'mail-utils)
 (require 'mel)
+(require 'semi-def)
 (require 'mime-view)
 (require 'signature)
 (require 'alist)
 
 (eval-and-compile
   (defconst mime-edit-version
-    (eval-when-compile
-      (concat
-       (mime-product-name mime-user-interface-product) " "
-       (mapconcat #'number-to-string
-                 (mime-product-version mime-user-interface-product) ".")
-       " - \"" (mime-product-code-name mime-user-interface-product) "\"")))
-  )
+    (concat
+     (mime-product-name mime-user-interface-product) " "
+     (mapconcat #'number-to-string
+               (mime-product-version mime-user-interface-product) ".")
+     " - \"" (mime-product-code-name mime-user-interface-product) "\"")))
 
 
 ;;; @ variables
@@ -221,6 +220,7 @@ To insert a signature file automatically, call the function
     ("application"
      ("octet-stream" ("type" "" "tar" "shar"))
      ("postscript")
+     ("vnd.ms-powerpoint")
      ("x-kiss" ("x-cnf")))
     ("image"
      ("gif")
@@ -305,6 +305,11 @@ To insert a signature file automatically, call the function
      "base64"
      "attachment" (("filename" . file))
      )
+    ("\\.ppt$"                         ; MS Power Point
+     "application" "vnd.ms-powerpoint" nil
+     "base64"
+     "attachment" (("filename" . file))
+     )
 
     ("\\.pln$"
      "text"    "plain"         nil
@@ -485,6 +490,7 @@ If encoding is nil, it is determined from its contents."
     (cn-big5           8 "base64")
     (big5              8 "base64")
     (shift_jis         8 "base64")
+    (tis-620           8 "base64")
     (iso-2022-jp-2     7 "base64")
     (iso-2022-int-1    7 "base64")
     ))
@@ -1792,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 (concat "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))
@@ -2163,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
 ;;;
@@ -2544,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
@@ -2559,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)
@@ -2681,7 +2691,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
           "^Content-Transfer-Encoding:" limit t)
          (let ((beg (match-beginning 0))
                (hbeg (match-end 0))
-               (end (std11-field-end)))
+               (end (std11-field-end limit)))
            (setq encoding
                  (downcase
                   (eliminate-top-spaces
@@ -2699,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)