From: Stefan Monnier Date: Thu, 6 Sep 2007 02:13:47 +0000 (+0000) Subject: (redisplay_internal): Make sure Elisp code always sees X-Git-Tag: emacs-pretest-23.0.90~11102 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/9859458022d0884ae31257aaff7f231d75b8ab8f (redisplay_internal): Make sure Elisp code always sees consistent values of selected_frame and selected_window. --- diff --git a/src/ChangeLog b/src/ChangeLog index d5f43d3899..e873cd1228 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-09-06 Stefan Monnier + + * xdisp.c (redisplay_internal): Make sure Elisp code always sees + consistent values of selected_frame and selected_window. + 2007-09-04 Jason Rumney * w32console.c (initialize_w32_display): Zero unused hooks. diff --git a/src/xdisp.c b/src/xdisp.c index d16e13ef72..618a53836a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10847,6 +10847,7 @@ redisplay_internal (preserve_echo_area) int count, count1; struct frame *sf; int polling_stopped_here = 0; + Lisp_Object old_frame = selected_frame; /* Non-zero means redisplay has to consider all windows on all frames. Zero means, only selected_window is considered. */ @@ -10908,6 +10909,14 @@ redisplay_internal (preserve_echo_area) } retry: + if (!EQ (old_frame, selected_frame) + && FRAME_LIVE_P (XFRAME (old_frame))) + /* When running redisplay, we play a bit fast-and-loose and allow e.g. + selected_frame and selected_window to be temporarily out-of-sync so + when we come back here via `goto retry', we need to resync because we + may need to run Elisp code (via prepare_menu_bars). */ + select_frame_for_redisplay (old_frame); + pause = 0; reconsider_clip_changes (w, current_buffer); last_escape_glyph_frame = NULL;