changeset 12222:7286ed64badd

(Fdelete_frame): If the minibuf window was selected, make that remain so.
author Richard M. Stallman <rms@gnu.org>
date Wed, 14 Jun 1995 18:20:14 +0000
parents 2fb3fef43166
children b31ac5b894c1
files src/frame.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Wed Jun 14 16:22:27 1995 +0000
+++ b/src/frame.c	Wed Jun 14 18:20:14 1995 +0000
@@ -901,6 +901,7 @@
      Lisp_Object frame, force;
 {
   struct frame *f;
+  int minibuffer_selected;
 
   if (EQ (frame, Qnil))
     {
@@ -940,6 +941,8 @@
 	}
     }
 
+  minibuffer_selected = EQ (minibuf_window, selected_window);
+
   /* Don't let the frame remain selected.  */
   if (f == selected_frame)
     Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
@@ -950,6 +953,11 @@
       Fset_window_buffer (selected_frame->minibuffer_window,
 			  XWINDOW (minibuf_window)->buffer);
       minibuf_window = selected_frame->minibuffer_window;
+
+      /* If the dying minibuffer window was selected,
+	 select the new one.  */
+      if (minibuffer_selected)
+	Fselect_window (minibuf_window);
     }
 
   /* Clear any X selections for this frame.  */