From 44a1490c3aa263eaf4767659435b4ffd76166b73 Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 23 Nov 1997 15:35:31 +0000 Subject: [PATCH] (mime-maybe-hide-echo-buffer): New inline function; abolish `mime-hide-echo-buffer'. (mime-view-mode): Use `mime-maybe-hide-echo-buffer'. --- mime-view.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/mime-view.el b/mime-view.el index 9458b16..b14bcbf 100644 --- a/mime-view.el +++ b/mime-view.el @@ -6,7 +6,7 @@ ;; Created: 1994/7/13 ;; Renamed: 1994/8/31 from tm-body.el ;; Renamed: 1997/02/19 from tm-view.el -;; Version: $Revision: 0.116 $ +;; Version: $Revision: 0.117 $ ;; Keywords: MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -39,7 +39,7 @@ ;;; (defconst mime-view-RCS-ID - "$Id: mime-view.el,v 0.116 1997-11-15 14:55:44 morioka Exp $") + "$Id: mime-view.el,v 0.117 1997-11-23 15:35:31 morioka Exp $") (defconst mime-view-version `,(get-version-string mime-view-RCS-ID)) @@ -820,12 +820,17 @@ The compressed face will be piped to this command.") (run-hooks 'mime-view-define-keymap-hook) )) -(defsubst mime-hide-echo-buffer () - "Hide mime-echo buffer." - (let ((win (get-buffer-window mime-echo-buffer-name))) - (if win - (delete-window win) - ))) +(defsubst mime-maybe-hide-echo-buffer () + "Clear mime-echo buffer and delete window for it." + (let ((buf (get-buffer mime-echo-buffer-name))) + (if buf + (save-excursion + (set-buffer buf) + (erase-buffer) + (let ((win (get-buffer-window buf))) + (if win + (delete-window win) + )))))) (defun mime-view-mode (&optional mother ctl encoding ibuf obuf default-keymap-or-function) @@ -853,13 +858,7 @@ button-2 Move to point under the mouse cursor and decode current content as `play mode' " (interactive) - (let ((buf (get-buffer mime-echo-buffer-name))) - (if buf - (save-excursion - (set-buffer buf) - (erase-buffer) - (mime-hide-echo-buffer) - ))) + (mime-maybe-hide-echo-buffer) (let ((ret (mime-view-setup-buffers ctl encoding ibuf obuf)) (win-conf (current-window-configuration)) ) -- 1.7.10.4