(mime-editor::edit-again): fixed about multipart.
authormorioka <morioka>
Mon, 3 Jun 1996 17:39:10 +0000 (17:39 +0000)
committermorioka <morioka>
Mon, 3 Jun 1996 17:39:10 +0000 (17:39 +0000)
mime-edit.el

index 5891dd4..8610151 100644 (file)
@@ -9,7 +9,7 @@
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1994/08/21 renamed from mime.el by UMEDA Masanobu;
 ;;;          1996/05/24 renamed from tm-edit.el
-;;; Version: $Revision: 0.21 $
+;;; Version: $Revision: 0.22 $
 ;;; Keywords: mail, news, MIME, multimedia, multilingual
 ;;;
 ;;; This file is part of SEMI (September, Emacs MIME Interface)
 ;;;
 
 (defconst mime-editor/RCS-ID
-  "$Id: mime-edit.el,v 0.21 1996-05-29 09:57:53 morioka Exp $")
+  "$Id: mime-edit.el,v 0.22 1996-06-03 17:39:10 morioka Exp $")
 
 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
 
@@ -2597,27 +2597,30 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
              )
            (cond
             ((string-equal type "multipart")
-             (let ((boundary (assoc-value "boundary" params)))
-               (re-search-forward (concat "\n--" boundary) nil t)
+             (let* ((boundary (assoc-value "boundary" params))
+                    (boundary-pat
+                     (concat "\n--" (regexp-quote boundary) "[ \t]*\n"))
+                    )
+               (re-search-forward boundary-pat nil t)
                (let ((bb (match-beginning 0)) eb tag)
                  (setq tag (format "\n--<<%s>>-{\n" stype))
                  (goto-char bb)
                  (insert tag)
                  (setq bb (+ bb (length tag)))
-                 (re-search-forward (concat "\n--" boundary "--") nil t)
+                 (re-search-forward
+                  (concat "\n--" (regexp-quote boundary) "--[ \t]*\n")
+                  nil t)
                  (setq eb (match-beginning 0))
-                 (replace-match (format "--}-<<%s>>" stype))
+                 (replace-match (format "--}-<<%s>>\n" stype))
                  (save-restriction
                    (narrow-to-region bb eb)
                    (goto-char (point-min))
-                   (while (re-search-forward
-                           (concat "\n--" boundary "\n") nil t)
+                   (while (re-search-forward boundary-pat nil t)
                      (let ((beg (match-beginning 0))
                            end)
                        (delete-region beg (match-end 0))
                        (save-excursion
-                         (if (re-search-forward
-                              (concat "\n--" boundary) nil t)
+                         (if (re-search-forward boundary-pat nil t)
                              (setq end (match-beginning 0))
                            (setq end (point-max))
                            )
@@ -2630,7 +2633,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
                (goto-char (point-min))
                (or (= (point-min) 1)
                    (delete-region (point-min)
-                                  (if (re-search-forward "^$" nil t)
+                                  (if (search-forward "\n\n" nil t)
                                       (match-end 0)
                                     (point-min)
                                     )))