tm 7.103.2.
[elisp/tm.git] / tm-play.el
index d901e00..dc85793 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Created: 1995/9/26 (separated from tm-view.el)
-;; Version: $Id: tm-play.el,v 7.39 1997/02/01 17:54:51 morioka Exp $
+;; Version: $Id: tm-play.el,v 7.40 1997/02/04 11:04:07 morioka Exp $
 ;; Keywords: mail, news, MIME, multimedia
 
 ;; This file is part of tm (Tools for MIME).
                  (progn
                    (or (file-exists-p total-file)
                        (save-excursion
-                         (set-buffer (find-file-noselect total-file))
+                         (set-buffer
+                          (get-buffer-create mime/temp-buffer-name))
                          (erase-buffer)
                          (insert total)
-                         (save-buffer)
+                         (write-file total-file)
                          (kill-buffer (current-buffer))
                          ))
                    (string-to-number total)
                (and (file-exists-p total-file)
                     (save-excursion
                       (set-buffer (find-file-noselect total-file))
-                      (and (re-search-forward "[0-9]+" nil t)
-                           (string-to-number
-                            (buffer-substring (match-beginning 0)
-                                              (match-end 0)))
-                           )
-                      (kill-buffer (current-buffer))
-                      ))
+                      (prog1
+                          (and (re-search-forward "[0-9]+" nil t)
+                               (string-to-number
+                                (buffer-substring (match-beginning 0)
+                                                  (match-end 0)))
+                               )
+                        (kill-buffer (current-buffer))
+                        )))
                )))
       (if (and total (> total 0))
          (catch 'tag
                (let ((i 1))
                  (while (<= i total)
                    (setq file (concat root-dir "/" (int-to-string i)))
-                   (if (not (file-exists-p file))
+                   (or (file-exists-p file)
                        (throw 'tag nil)
-                     )
+                       )
                    (as-binary-input-file (insert-file-contents file))
                    (goto-char (point-max))
                    (setq i (1+ i))