comparison src/xdisp.c @ 21424:fbfd26142e76

(redisplay_window): If updating mode line, temporarily change selected_frame
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Apr 1998 07:15:02 +0000
parents 8f9e7600c250
children 3cb2644c8dd2
comparison
equal deleted inserted replaced
21423:f866f7cadda2 21424:fbfd26142e76
1737 int opoint = PT; 1737 int opoint = PT;
1738 int opoint_byte = PT_BYTE; 1738 int opoint_byte = PT_BYTE;
1739 int tem; 1739 int tem;
1740 int update_mode_line; 1740 int update_mode_line;
1741 struct Lisp_Char_Table *dp = window_display_table (w); 1741 struct Lisp_Char_Table *dp = window_display_table (w);
1742 int really_switched_buffer = 0;
1742 1743
1743 if (Z == Z_BYTE && lpoint != lpoint_byte) 1744 if (Z == Z_BYTE && lpoint != lpoint_byte)
1744 abort (); 1745 abort ();
1745 if (lpoint_byte < lpoint) 1746 if (lpoint_byte < lpoint)
1746 abort (); 1747 abort ();
1792 } 1793 }
1793 1794
1794 /* Otherwise set up data on this window; select its buffer and point value */ 1795 /* Otherwise set up data on this window; select its buffer and point value */
1795 1796
1796 if (update_mode_line) 1797 if (update_mode_line)
1797 set_buffer_internal_1 (XBUFFER (w->buffer)); 1798 /* Really select the buffer, for the sake of buffer-local variables. */
1799 {
1800 set_buffer_internal_1 (XBUFFER (w->buffer));
1801 really_switched_buffer = 1;
1802 }
1798 else 1803 else
1799 set_buffer_temp (XBUFFER (w->buffer)); 1804 set_buffer_temp (XBUFFER (w->buffer));
1800 1805
1801 opoint = PT; 1806 opoint = PT;
1802 opoint_byte = PT_BYTE; 1807 opoint_byte = PT_BYTE;
1923 if (!update_mode_line 1928 if (!update_mode_line
1924 || ! NILP (Vwindow_scroll_functions)) 1929 || ! NILP (Vwindow_scroll_functions))
1925 { 1930 {
1926 Lisp_Object temp[3]; 1931 Lisp_Object temp[3];
1927 1932
1928 set_buffer_temp (old); 1933 if (!really_switched_buffer)
1929 set_buffer_internal_1 (XBUFFER (w->buffer)); 1934 {
1935 set_buffer_temp (old);
1936 set_buffer_internal_1 (XBUFFER (w->buffer));
1937 }
1938 really_switched_buffer = 1;
1930 update_mode_line = 1; 1939 update_mode_line = 1;
1931 w->update_mode_line = Qt; 1940 w->update_mode_line = Qt;
1932 if (! NILP (Vwindow_scroll_functions)) 1941 if (! NILP (Vwindow_scroll_functions))
1933 { 1942 {
1934 run_hook_with_args_2 (Qwindow_scroll_functions, window, 1943 run_hook_with_args_2 (Qwindow_scroll_functions, window,
2168 XSETFASTINT (w->last_modified, 0); 2177 XSETFASTINT (w->last_modified, 0);
2169 XSETFASTINT (w->last_overlay_modified, 0); 2178 XSETFASTINT (w->last_overlay_modified, 0);
2170 /* Redisplay the mode line. Select the buffer properly for that. */ 2179 /* Redisplay the mode line. Select the buffer properly for that. */
2171 if (!update_mode_line) 2180 if (!update_mode_line)
2172 { 2181 {
2173 set_buffer_temp (old); 2182 if (!really_switched_buffer)
2174 set_buffer_internal_1 (XBUFFER (w->buffer)); 2183 {
2184 set_buffer_temp (old);
2185 set_buffer_internal_1 (XBUFFER (w->buffer));
2186 }
2175 update_mode_line = 1; 2187 update_mode_line = 1;
2176 w->update_mode_line = Qt; 2188 w->update_mode_line = Qt;
2177 } 2189 }
2178 2190
2179 /* Try to scroll by specified few lines */ 2191 /* Try to scroll by specified few lines */
2355 || (!just_this_one && !WINDOW_FULL_WIDTH_P (w)) 2367 || (!just_this_one && !WINDOW_FULL_WIDTH_P (w))
2356 || INTEGERP (w->base_line_pos) 2368 || INTEGERP (w->base_line_pos)
2357 || (!NILP (w->column_number_displayed) 2369 || (!NILP (w->column_number_displayed)
2358 && XFASTINT (w->column_number_displayed) != current_column ())) 2370 && XFASTINT (w->column_number_displayed) != current_column ()))
2359 && height != XFASTINT (w->height)) 2371 && height != XFASTINT (w->height))
2360 display_mode_line (w); 2372 {
2373 FRAME_PTR oframe = selected_frame;
2374 if (!really_switched_buffer)
2375 {
2376 set_buffer_temp (old);
2377 set_buffer_internal_1 (XBUFFER (w->buffer));
2378 really_switched_buffer = 1;
2379 }
2380 selected_frame = f;
2381 display_mode_line (w);
2382 selected_frame = oframe;
2383 }
2361 if (! line_number_displayed 2384 if (! line_number_displayed
2362 && ! BUFFERP (w->base_line_pos)) 2385 && ! BUFFERP (w->base_line_pos))
2363 { 2386 {
2364 w->base_line_pos = Qnil; 2387 w->base_line_pos = Qnil;
2365 w->base_line_number = Qnil; 2388 w->base_line_number = Qnil;
2412 so it shouldn't be deleted at the end of redisplay. */ 2435 so it shouldn't be deleted at the end of redisplay. */
2413 (*redeem_scroll_bar_hook) (w); 2436 (*redeem_scroll_bar_hook) (w);
2414 } 2437 }
2415 2438
2416 TEMP_SET_PT_BOTH (opoint, opoint_byte); 2439 TEMP_SET_PT_BOTH (opoint, opoint_byte);
2417 if (update_mode_line) 2440 if (really_switched_buffer)
2418 set_buffer_internal_1 (old); 2441 set_buffer_internal_1 (old);
2419 else 2442 else
2420 set_buffer_temp (old); 2443 set_buffer_temp (old);
2421 TEMP_SET_PT_BOTH (lpoint, lpoint_byte); 2444 TEMP_SET_PT_BOTH (lpoint, lpoint_byte);
2422 } 2445 }