(mime-maybe-hide-echo-buffer): New inline function; abolish
authormorioka <morioka>
Sun, 23 Nov 1997 15:35:31 +0000 (15:35 +0000)
committermorioka <morioka>
Sun, 23 Nov 1997 15:35:31 +0000 (15:35 +0000)
`mime-hide-echo-buffer'.
(mime-view-mode): Use `mime-maybe-hide-echo-buffer'.

mime-view.el

index 9458b16..b14bcbf 100644 (file)
@@ -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))
        )