# HG changeset patch # User Gerd Moellmann # Date 1000823351 0 # Node ID 96fc00b78011e3c0c908f77ab2c874b16b4c4c4d # Parent b20b329387f59d3ca6f81fc9e8d90fbeb6097fc0 (Frecursive_edit): Pass (BUFFER . SINGLE-KBOARD) to recursive_edit_unwind. (recursive_edit_unwind): Set kboard state according to SINGLE-KBOARD. diff -r b20b329387f5 -r 96fc00b78011 src/keyboard.c --- a/src/keyboard.c Tue Sep 18 13:51:22 2001 +0000 +++ b/src/keyboard.c Tue Sep 18 14:29:11 2001 +0000 @@ -690,6 +690,7 @@ static void restore_getcjmp P_ ((jmp_buf)); static Lisp_Object apply_modifiers P_ ((int, Lisp_Object)); static void clear_event P_ ((struct input_event *)); +static void any_kboard_state P_ ((void)); /* Nonzero means don't try to suspend even if the operating system seems to support it. */ @@ -984,30 +985,45 @@ () { int count = specpdl_ptr - specpdl; + Lisp_Object buffer; command_loop_level++; update_mode_lines = 1; + if (command_loop_level + && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) + buffer = Fcurrent_buffer (); + else + buffer = Qnil; + + /* If we leave recursive_edit_1 below with a `throw' for instance, + like it is done in the splash screen display, we have to + make sure that we restore single_kboard as command_loop_1 + would have done if it were left normally. */ record_unwind_protect (recursive_edit_unwind, - (command_loop_level - && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) - ? Fcurrent_buffer () - : Qnil); + Fcons (buffer, single_kboard ? Qt : Qnil)); + recursive_edit_1 (); return unbind_to (count, Qnil); } Lisp_Object -recursive_edit_unwind (buffer) - Lisp_Object buffer; -{ - if (!NILP (buffer)) - Fset_buffer (buffer); - +recursive_edit_unwind (info) + Lisp_Object info; +{ + if (BUFFERP (XCAR (info))) + Fset_buffer (XCAR (info)); + + if (NILP (XCDR (info))) + any_kboard_state (); + else + single_kboard_state (); + command_loop_level--; update_mode_lines = 1; return Qnil; } + static void any_kboard_state ()