diff options
author | Samuel Bronson <naesten@gmail.com> | 2014-05-06 12:16:57 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-05-06 12:16:57 -0400 |
commit | 8e102bcc97871ed6e0d2deba84fe46d9a78e9e44 (patch) | |
tree | 3634264eb0564610256f3e67848a6867d4c52d95 | |
parent | 863f07dea0ce02fd8263f5363c9d50504fc4af6e (diff) | |
download | emacs-8e102bcc97871ed6e0d2deba84fe46d9a78e9e44.tar.gz |
* src/keyboard.c (Frecursive_edit): Ensure inc&dec of command_loop_level
are matched.
Fixes: debbugs:17413
-rw-r--r-- | lib-src/ChangeLog | 2 | ||||
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/keyboard.c | 13 |
3 files changed, 14 insertions, 6 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 2176549a351..c0df532fbb6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -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). diff --git a/src/ChangeLog b/src/ChangeLog index 720ab11135f..c1d45f1df40 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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). diff --git a/src/keyboard.c b/src/keyboard.c index 90479375072..8bc0c108739 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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); |