From: morioka Date: Tue, 23 Jun 1998 14:12:13 +0000 (+0000) Subject: (mime-display-message): Use window of preview-buffer or preview-buffer X-Git-Tag: semi-1_8_0~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=557d9a772046f9369e0450bdaa15d6be2e805dc4;p=elisp%2Fsemi.git (mime-display-message): Use window of preview-buffer or preview-buffer to display preview-buffer. (mime-view-buffer): fixed. (mime-view-mode): fixed. --- diff --git a/mime-view.el b/mime-view.el index f9f381c..bba8aed 100644 --- a/mime-view.el +++ b/mime-view.el @@ -936,7 +936,7 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (set-buffer raw-buffer) (setq mime-preview-buffer preview-buffer) (let ((inhibit-read-only t)) - (switch-to-buffer preview-buffer) + (set-buffer (get-buffer-create preview-buffer)) (widen) (erase-buffer) (setq mime-raw-buffer raw-buffer) @@ -959,19 +959,21 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (search-forward "\n\n" nil t) )) (run-hooks 'mime-view-mode-hook) - )) - (set-buffer-modified-p nil) - (setq buffer-read-only t) - ) + (set-buffer-modified-p nil) + (setq buffer-read-only t) + (or (get-buffer-window preview-buffer) + (let ((r-win (get-buffer-window raw-buffer))) + (if r-win + (set-window-buffer r-win preview-buffer) + (switch-to-buffer preview-buffer) + ))) + ))) (defun mime-view-buffer (&optional raw-buffer preview-buffer mother default-keymap-or-function) (interactive) (mime-display-message - (save-excursion - (if raw-buffer (set-buffer raw-buffer)) - (mime-parse-message) - ) + (mime-parse-buffer raw-buffer) preview-buffer mother default-keymap-or-function)) (defun mime-view-mode (&optional mother ctl encoding @@ -1004,7 +1006,7 @@ button-2 Move to point under the mouse cursor (save-excursion (if raw-buffer (set-buffer raw-buffer)) (or mime-view-redisplay - (mime-parse-message ctl encoding)) + (setq mime-message-structure (mime-parse-message ctl encoding))) ) preview-buffer mother default-keymap-or-function))