* src/keyboard.c (Frecursive_edit): Ensure inc&dec of command_loop_level

are matched.

Fixes: debbugs:17413
This commit is contained in:
Samuel Bronson 2014-05-06 12:16:57 -04:00 committed by Stefan Monnier
parent 863f07dea0
commit 8e102bcc97
3 changed files with 14 additions and 6 deletions

View file

@ -688,7 +688,7 @@
Use _Noreturn rather than NO_RETURN.
No need for separate decl merely because of _Noreturn.
2012-06-24 Samuel Bronson <naesten@gmail.com> (tiny change)
2012-06-24 Samuel Bronson <naesten@gmail.com>
* emacsclient.c (set_local_socket): Fix compiler warning (Bug#7838).

View file

@ -1,3 +1,8 @@
2014-05-06 Samuel Bronson <naesten@gmail.com>
* keyboard.c (Frecursive_edit): Ensure inc&dec of command_loop_level
are matched (bug#17413).
2014-05-06 Jarek Czekalski <jarekczek@poczta.onet.pl>
Stop tooltips pulling Emacs window to front (Bug#17408).

View file

@ -825,22 +825,25 @@ This function is called by the editor initialization to begin editing. */)
if (input_blocked_p ())
return Qnil;
command_loop_level++;
update_mode_lines = 17;
if (command_loop_level
if (command_loop_level >= 0
&& current_buffer != XBUFFER (XWINDOW (selected_window)->contents))
buffer = Fcurrent_buffer ();
else
buffer = Qnil;
/* Don't do anything interesting between the increment and the
record_unwind_protect! Otherwise, we could get distracted and
never decrement the counter again. */
command_loop_level++;
update_mode_lines = 17;
record_unwind_protect (recursive_edit_unwind, buffer);
/* 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. */
if (command_loop_level > 0)
temporarily_switch_to_single_kboard (SELECTED_FRAME ());
record_unwind_protect (recursive_edit_unwind, buffer);
recursive_edit_1 ();
return unbind_to (count, Qnil);