changeset 23226:f16c96435677

(command_loop_1): When switching to selected window's bfr, first exit if selected frame is dead (no live frames remain). (read_key_sequence): Likewise.
author Karl Heuer <kwzh@gnu.org>
date Thu, 10 Sep 1998 15:47:53 +0000
parents 17a79bc7bfe1
children 457da99ff43a
files src/keyboard.c
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Thu Sep 10 15:46:18 1998 +0000
+++ b/src/keyboard.c	Thu Sep 10 15:47:53 1998 +0000
@@ -1200,6 +1200,9 @@
 
   while (1)
     {
+      if (! FRAME_LIVE_P (selected_frame))
+	Fkill_emacs (Qnil);
+
       /* Make sure the current window's buffer is selected.  */
       if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
 	set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
@@ -1271,6 +1274,8 @@
 			     Qnil, 0, 1, 1);
 
       /* A filter may have run while we were reading the input.  */
+      if (! FRAME_LIVE_P (selected_frame))
+	Fkill_emacs (Qnil);
       if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
 	set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
 
@@ -6993,8 +6998,12 @@
 		 This is to be more consistent with the behavior
 		 of the command_loop_1.  */
 	      if (fix_current_buffer)
-		if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
-		  Fset_buffer (XWINDOW (selected_window)->buffer);
+		{
+		  if (! FRAME_LIVE_P (selected_frame))
+		    Fkill_emacs (Qnil);
+		  if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
+		    Fset_buffer (XWINDOW (selected_window)->buffer);
+		}
 
 	      orig_local_map = get_local_map (PT, current_buffer);
 	      goto replay_sequence;
@@ -7092,6 +7101,8 @@
 		     emacsclient).  */
 		  record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
 
+		  if (! FRAME_LIVE_P (selected_frame))
+		    Fkill_emacs (Qnil);
 		  set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
 		  orig_local_map = get_local_map (PT, current_buffer);
 		  goto replay_sequence;