int tem;
int update_mode_line;
struct Lisp_Char_Table *dp = window_display_table (w);
+ int really_switched_buffer = 0;
if (Z == Z_BYTE && lpoint != lpoint_byte)
abort ();
/* Otherwise set up data on this window; select its buffer and point value */
if (update_mode_line)
- set_buffer_internal_1 (XBUFFER (w->buffer));
+ /* Really select the buffer, for the sake of buffer-local variables. */
+ {
+ set_buffer_internal_1 (XBUFFER (w->buffer));
+ really_switched_buffer = 1;
+ }
else
set_buffer_temp (XBUFFER (w->buffer));
{
Lisp_Object temp[3];
- set_buffer_temp (old);
- set_buffer_internal_1 (XBUFFER (w->buffer));
+ if (!really_switched_buffer)
+ {
+ set_buffer_temp (old);
+ set_buffer_internal_1 (XBUFFER (w->buffer));
+ }
+ really_switched_buffer = 1;
update_mode_line = 1;
w->update_mode_line = Qt;
if (! NILP (Vwindow_scroll_functions))
/* Redisplay the mode line. Select the buffer properly for that. */
if (!update_mode_line)
{
- set_buffer_temp (old);
- set_buffer_internal_1 (XBUFFER (w->buffer));
+ if (!really_switched_buffer)
+ {
+ set_buffer_temp (old);
+ set_buffer_internal_1 (XBUFFER (w->buffer));
+ }
update_mode_line = 1;
w->update_mode_line = Qt;
}
|| (!NILP (w->column_number_displayed)
&& XFASTINT (w->column_number_displayed) != current_column ()))
&& height != XFASTINT (w->height))
- display_mode_line (w);
+ {
+ FRAME_PTR oframe = selected_frame;
+ if (!really_switched_buffer)
+ {
+ set_buffer_temp (old);
+ set_buffer_internal_1 (XBUFFER (w->buffer));
+ really_switched_buffer = 1;
+ }
+ selected_frame = f;
+ display_mode_line (w);
+ selected_frame = oframe;
+ }
if (! line_number_displayed
&& ! BUFFERP (w->base_line_pos))
{
}
TEMP_SET_PT_BOTH (opoint, opoint_byte);
- if (update_mode_line)
+ if (really_switched_buffer)
set_buffer_internal_1 (old);
else
set_buffer_temp (old);