From 5e5aba89c2b8471c24d555046e84fba7e56b8b15 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 11 Jun 1998 09:17:05 +0000 Subject: [PATCH] (mime-view-display-message): Set up `mime-raw-message-info'. (mime-view-buffer): New function. (mime-view-mode): Don't set up `mime-raw-message-info'. --- mime-view.el | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/mime-view.el b/mime-view.el index 386b8a5..bcd0595 100644 --- a/mime-view.el +++ b/mime-view.el @@ -1055,8 +1055,11 @@ The compressed face will be piped to this command.") (or preview-buffer (setq preview-buffer (concat "*Preview-" (buffer-name raw-buffer) "*"))) + (set-buffer raw-buffer) + (setq mime-raw-message-info (mime-parse-message)) + (setq mime-preview-buffer preview-buffer) (let ((inhibit-read-only t)) - (set-buffer (get-buffer-create preview-buffer)) + (switch-to-buffer preview-buffer) (widen) (erase-buffer) (setq mime-raw-buffer raw-buffer) @@ -1072,23 +1075,31 @@ The compressed face will be piped to this command.") (header . visible) )) (mime-view-define-keymap default-keymap-or-function) - (set-buffer-modified-p nil) - ) - (setq buffer-read-only t) - (set-buffer raw-buffer) - ) - (switch-to-buffer (setq mime-preview-buffer preview-buffer)) - (let ((point - (next-single-property-change (point-min) 'mime-view-entity))) - (if point - (goto-char point) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (let ((point + (next-single-property-change (point-min) 'mime-view-entity))) + (if point + (goto-char point) + (goto-char (point-min)) + (search-forward "\n\n" nil t) + )) + (run-hooks 'mime-view-mode-hook) )) - (run-hooks 'mime-view-mode-hook) + (set-buffer-modified-p nil) + (setq buffer-read-only t) ) -(defun mime-view-mode (&optional mother ctl encoding raw-buffer obuf +(defun mime-view-buffer (&optional raw-buffer preview-buffer mother + default-keymap-or-function) + (interactive) + (mime-view-display-message + (save-excursion + (if raw-buffer (set-buffer raw-buffer)) + (mime-parse-message) + ) + preview-buffer mother default-keymap-or-function)) + +(defun mime-view-mode (&optional mother ctl encoding + raw-buffer preview-buffer default-keymap-or-function) "Major mode for viewing MIME message. @@ -1118,9 +1129,9 @@ button-2 Move to point under the mouse cursor (save-excursion (if raw-buffer (set-buffer raw-buffer)) (or mime-view-redisplay - (setq mime-raw-message-info (mime-parse-message ctl encoding)) - )) - obuf mother default-keymap-or-function)) + (mime-parse-message ctl encoding)) + ) + preview-buffer mother default-keymap-or-function)) ;;; @@ playing -- 1.7.10.4