From ba9fd5d7c668f7011418553559aa6f1268e358f0 Mon Sep 17 00:00:00 2001 From: hayashi Date: Tue, 11 Jul 2000 09:35:06 +0000 Subject: [PATCH] Merge REMI changes. * mime-pgp.el (mime-view-application/pgp): Setup local variable `mime-view-temp-message-buffer' of preview-buffer. (mime-view-application/pkcs7-mime): Likewise. * mime-play.el (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. --- ChangeLog | 16 ++++++++++++++++ mime-pgp.el | 27 +++++++++++++++++---------- mime-play.el | 32 +++++++++++++++++--------------- 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a4a4b9..f1364c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2000-07-11 MORIOKA Tomohiko + + * mime-pgp.el (mime-view-application/pgp): Setup local variable + `mime-view-temp-message-buffer' of preview-buffer. + (mime-view-application/pkcs7-mime): Likewise. + + * mime-play.el + (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. + 2000-07-08 Yoshiki Hayashi * mime-view.el (mime-display-text/plain): Make it a little diff --git a/mime-pgp.el b/mime-pgp.el index d3d66e1..718ad9e 100644 --- a/mime-pgp.el +++ b/mime-pgp.el @@ -1,8 +1,8 @@ ;;; mime-pgp.el --- mime-view internal methods for PGP. -;; Copyright (C) 1995,1996,1997,1998,1999 MORIOKA Tomohiko +;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Daiki Ueno ;; Created: 1995/12/7 ;; Renamed: 1997/2/27 from tm-pgp.el @@ -88,8 +88,8 @@ (format "%s-%s" (buffer-name) (mime-entity-number entity))) (mother (current-buffer)) (preview-buffer (concat "*Preview-" (buffer-name) "*")) - representation-type) - (set-buffer (get-buffer-create new-name)) + representation-type message-buf) + (set-buffer (setq message-buf (get-buffer-create new-name))) (erase-buffer) (mime-insert-entity entity) (cond ((progn @@ -119,8 +119,11 @@ (insert-buffer pgg-output-buffer) (setq representation-type 'binary))) (setq major-mode 'mime-show-message-mode) - (save-window-excursion (mime-view-buffer nil preview-buffer mother - nil representation-type)) + (save-window-excursion + (mime-view-buffer nil preview-buffer mother + nil representation-type) + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer message-buf)) (set-window-buffer p-win preview-buffer))) @@ -252,10 +255,11 @@ (new-name (format "%s-%s" (buffer-name) (mime-entity-number entity))) (mother (current-buffer)) - (preview-buffer (concat "*Preview-" (buffer-name) "*"))) + (preview-buffer (concat "*Preview-" (buffer-name) "*")) + message-buf) (when (memq (or (cdr (assq 'smime-type situation)) 'enveloped-data) '(enveloped-data signed-data)) - (set-buffer (get-buffer-create new-name)) + (set-buffer (setq message-buf (get-buffer-create new-name))) (let ((inhibit-read-only t) buffer-read-only) (erase-buffer) @@ -264,8 +268,11 @@ (delete-region (point-min)(point-max)) (insert-buffer smime-output-buffer)) (setq major-mode 'mime-show-message-mode) - (save-window-excursion (mime-view-buffer nil preview-buffer mother - nil 'binary)) + (save-window-excursion + (mime-view-buffer nil preview-buffer mother + nil 'binary) + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer message-buf)) (set-window-buffer p-win preview-buffer)))) diff --git a/mime-play.el b/mime-play.el index 65c8988..302c4ff 100644 --- a/mime-play.el +++ b/mime-play.el @@ -507,13 +507,11 @@ 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-body-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)) - ;; Existence of raw-buffer is not guaranteed. - (if raw-buffer - (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))) @@ -562,10 +560,12 @@ 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))) + (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)) (setq file (concat root-dir "/" number)) @@ -598,8 +598,7 @@ It is registered to variable `mime-preview-quitting-method-alist'." (catch 'tag (save-excursion (set-buffer (get-buffer-create mime-temp-buffer-name)) - ;; #### ??? full-buf is not referenced. -;; (let ((full-buf (current-buffer))) + (let ((full-buf (current-buffer))) (erase-buffer) (let ((i 1)) (while (<= i total) @@ -609,9 +608,8 @@ It is registered to variable `mime-preview-quitting-method-alist'." (as-binary-input-file (insert-file-contents file)) (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))) @@ -621,13 +619,17 @@ It is registered to variable `mime-preview-quitting-method-alist'." (let ((file (expand-file-name "CT" root-dir))) (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)))))))) + (select-window pwin))))))))) ;;; @ message/external-body -- 1.7.10.4