Mercurial > emacs
comparison src/xdisp.c @ 39444:880534cbcad7
(display_mode_lines): Temporarily set selected_frame
and selected_window to the frame of the window whose mode-lines
are display, and to the window itself.
(redisplay_window, redisplay_mode_lines): Don't set selected_frame
here.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 26 Sep 2001 08:18:07 +0000 |
parents | 8c76e11c46a4 |
children | e0fb6798db26 |
comparison
equal
deleted
inserted
replaced
39443:b6e7a04b7eeb | 39444:880534cbcad7 |
---|---|
10354 && XFASTINT (w->column_number_displayed) != current_column ())) | 10354 && XFASTINT (w->column_number_displayed) != current_column ())) |
10355 /* This means that the window has a mode line. */ | 10355 /* This means that the window has a mode line. */ |
10356 && (WINDOW_WANTS_MODELINE_P (w) | 10356 && (WINDOW_WANTS_MODELINE_P (w) |
10357 || WINDOW_WANTS_HEADER_LINE_P (w))) | 10357 || WINDOW_WANTS_HEADER_LINE_P (w))) |
10358 { | 10358 { |
10359 Lisp_Object old_selected_frame; | |
10360 | |
10361 old_selected_frame = selected_frame; | |
10362 | |
10363 XSETFRAME (selected_frame, f); | |
10364 display_mode_lines (w); | 10359 display_mode_lines (w); |
10365 selected_frame = old_selected_frame; | |
10366 | 10360 |
10367 /* If mode line height has changed, arrange for a thorough | 10361 /* If mode line height has changed, arrange for a thorough |
10368 immediate redisplay using the correct mode line height. */ | 10362 immediate redisplay using the correct mode line height. */ |
10369 if (WINDOW_WANTS_MODELINE_P (w) | 10363 if (WINDOW_WANTS_MODELINE_P (w) |
10370 && CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w)) | 10364 && CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w)) |
13219 nwindows += redisplay_mode_lines (w->vchild, force); | 13213 nwindows += redisplay_mode_lines (w->vchild, force); |
13220 else if (force | 13214 else if (force |
13221 || FRAME_GARBAGED_P (XFRAME (w->frame)) | 13215 || FRAME_GARBAGED_P (XFRAME (w->frame)) |
13222 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) | 13216 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) |
13223 { | 13217 { |
13224 Lisp_Object old_selected_frame; | |
13225 struct text_pos lpoint; | 13218 struct text_pos lpoint; |
13226 struct buffer *old = current_buffer; | 13219 struct buffer *old = current_buffer; |
13227 | 13220 |
13228 /* Set the window's buffer for the mode line display. */ | 13221 /* Set the window's buffer for the mode line display. */ |
13229 SET_TEXT_POS (lpoint, PT, PT_BYTE); | 13222 SET_TEXT_POS (lpoint, PT, PT_BYTE); |
13242 TEMP_SET_PT_BOTH (ZV, ZV_BYTE); | 13235 TEMP_SET_PT_BOTH (ZV, ZV_BYTE); |
13243 else | 13236 else |
13244 TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt)); | 13237 TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt)); |
13245 } | 13238 } |
13246 | 13239 |
13247 /* Temporarily set up the selected frame. */ | |
13248 old_selected_frame = selected_frame; | |
13249 selected_frame = w->frame; | |
13250 | |
13251 /* Display mode lines. */ | 13240 /* Display mode lines. */ |
13252 clear_glyph_matrix (w->desired_matrix); | 13241 clear_glyph_matrix (w->desired_matrix); |
13253 if (display_mode_lines (w)) | 13242 if (display_mode_lines (w)) |
13254 { | 13243 { |
13255 ++nwindows; | 13244 ++nwindows; |
13256 w->must_be_updated_p = 1; | 13245 w->must_be_updated_p = 1; |
13257 } | 13246 } |
13258 | 13247 |
13259 /* Restore old settings. */ | 13248 /* Restore old settings. */ |
13260 selected_frame = old_selected_frame; | |
13261 set_buffer_internal_1 (old); | 13249 set_buffer_internal_1 (old); |
13262 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); | 13250 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); |
13263 } | 13251 } |
13264 | 13252 |
13265 window = w->next; | 13253 window = w->next; |
13274 | 13262 |
13275 static int | 13263 static int |
13276 display_mode_lines (w) | 13264 display_mode_lines (w) |
13277 struct window *w; | 13265 struct window *w; |
13278 { | 13266 { |
13267 Lisp_Object old_selected_window, old_selected_frame; | |
13279 int n = 0; | 13268 int n = 0; |
13269 | |
13270 old_selected_frame = selected_frame; | |
13271 selected_frame = w->frame; | |
13272 old_selected_window = selected_window; | |
13273 XSETWINDOW (selected_window, w); | |
13280 | 13274 |
13281 /* These will be set while the mode line specs are processed. */ | 13275 /* These will be set while the mode line specs are processed. */ |
13282 line_number_displayed = 0; | 13276 line_number_displayed = 0; |
13283 w->column_number_displayed = Qnil; | 13277 w->column_number_displayed = Qnil; |
13284 | 13278 |
13294 display_mode_line (w, HEADER_LINE_FACE_ID, | 13288 display_mode_line (w, HEADER_LINE_FACE_ID, |
13295 current_buffer->header_line_format); | 13289 current_buffer->header_line_format); |
13296 ++n; | 13290 ++n; |
13297 } | 13291 } |
13298 | 13292 |
13293 selected_frame = old_selected_frame; | |
13294 selected_window = old_selected_window; | |
13299 return n; | 13295 return n; |
13300 } | 13296 } |
13301 | 13297 |
13302 | 13298 |
13303 /* Display mode or top line of window W. FACE_ID specifies which line | 13299 /* Display mode or top line of window W. FACE_ID specifies which line |