From: tomo Date: Tue, 11 Jul 2000 06:45:44 +0000 (+0000) Subject: (mime-preview-quitting-method-for-mime-show-message-mode): Don't use X-Git-Tag: emacs-21_0_90-semi-remi-1_14_2-0~10 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb8d1f49f1c060d78d9c73164fb01d1408b7c224;p=elisp%2Fsemi.git (mime-preview-quitting-method-for-mime-show-message-mode): Don't use `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. --- diff --git a/mime-play.el b/mime-play.el index e3774de..e43b872 100644 --- a/mime-play.el +++ b/mime-play.el @@ -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) )))))