(mime-preview-quitting-method-for-mime-show-message-mode): Don't use
authortomo <tomo>
Tue, 11 Jul 2000 06:45:44 +0000 (06:45 +0000)
committertomo <tomo>
Tue, 11 Jul 2000 06:45:44 +0000 (06:45 +0000)
`mime-entity-buffer'; refer `mime-view-temp-message-buffer'.
(mime-store-message/partial-piece): Use
`insert-file-contents-as-binary' instead of
`(as-binary-input-file (insert-file-contents ...))'; use
`write-region-as-binary' instead of
`(as-binary-output-file (write-region ...)); setup local variable
`mime-view-temp-message-buffer' of preview-buffer.

mime-play.el

index e3774de..e43b872 100644 (file)
@@ -315,15 +315,14 @@ SUBTYPE is symbol to indicate subtype of media-type.")
 (defun mime-preview-quitting-method-for-mime-show-message-mode ()
   "Quitting method for mime-view.
 It is registered to variable `mime-preview-quitting-method-alist'."
-  (let ((raw-buffer (mime-entity-buffer
-                    (get-text-property (point-min) 'mime-view-entity)))
-       (mother mime-mother-buffer)
+  (let ((mother mime-mother-buffer)
        (win-conf mime-preview-original-window-configuration))
-    (kill-buffer raw-buffer)
+    (if (and (boundp 'mime-view-temp-message-buffer)
+            (buffer-live-p mime-view-temp-message-buffer))
+       (kill-buffer mime-view-temp-message-buffer))
     (mime-preview-kill-buffer)
     (set-window-configuration win-conf)
-    (pop-to-buffer mother)
-    ))
+    (pop-to-buffer mother)))
 
 (defun mime-view-message/rfc822 (entity situation)
   (let* ((new-name
@@ -370,14 +369,14 @@ It is registered to variable `mime-preview-quitting-method-alist'."
          (save-window-excursion
            (set-buffer full-buf)
            (erase-buffer)
-           (as-binary-input-file (insert-file-contents file))
+           (insert-file-contents-as-binary file)
            (setq major-mode 'mime-show-message-mode)
            (mime-view-buffer (current-buffer) nil mother)
            (setq pbuf (current-buffer))
-           )
+           (make-local-variable 'mime-view-temp-message-buffer)
+           (setq mime-view-temp-message-buffer full-buf))
          (set-window-buffer pwin pbuf)
-         (select-window pwin)
-         )
+         (select-window pwin))
       (setq file (concat root-dir "/" number))
       (mime-write-entity-body entity file)
       (let ((total-file (concat root-dir "/CT")))
@@ -425,9 +424,8 @@ It is registered to variable `mime-preview-quitting-method-alist'."
                    (goto-char (point-max))
                    (setq i (1+ i))
                    ))
-               (as-binary-output-file
-                (write-region (point-min)(point-max)
-                              (expand-file-name "FULL" root-dir)))
+               (write-region-as-binary (point-min)(point-max)
+                                       (expand-file-name "FULL" root-dir))
                (let ((i 1))
                  (while (<= i total)
                    (let ((file (format "%s/%d" root-dir i)))
@@ -440,11 +438,15 @@ It is registered to variable `mime-preview-quitting-method-alist'."
                  (and (file-exists-p file)
                       (delete-file file)
                       ))
-               (let ((pwin (or (get-buffer-window mother)
+               (let ((buf (current-buffer))
+                     (pwin (or (get-buffer-window mother)
                                (get-largest-window)))
                      (pbuf (mime-display-message
                             (mime-open-entity 'buffer (current-buffer))
                             nil mother nil 'mime-show-message-mode)))
+                 (with-current-buffer pbuf
+                   (make-local-variable 'mime-view-temp-message-buffer)
+                   (setq mime-view-temp-message-buffer buf))
                  (set-window-buffer pwin pbuf)
                  (select-window pwin)
                  )))))