Mercurial > emacs
comparison src/xdisp.c @ 62941:b5b6bc3bd36b
(display_mode_line): Support nested calls to redisplay
and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 31 May 2005 22:46:22 +0000 |
parents | 3c0952cf4004 |
children | 6ab08ae41502 |
comparison
equal
deleted
inserted
replaced
62940:f0edea1ecc22 | 62941:b5b6bc3bd36b |
---|---|
8350 | 8350 |
8351 /* Set global variable indicating that multiple frames exist. */ | 8351 /* Set global variable indicating that multiple frames exist. */ |
8352 multiple_frames = CONSP (tail); | 8352 multiple_frames = CONSP (tail); |
8353 | 8353 |
8354 /* Switch to the buffer of selected window of the frame. Set up | 8354 /* Switch to the buffer of selected window of the frame. Set up |
8355 mode_line_noprop_ptr so that display_mode_element will output into it; | 8355 mode_line_target so that display_mode_element will output into |
8356 then display the title. */ | 8356 mode_line_noprop_buf; then display the title. */ |
8357 record_unwind_protect (unwind_format_mode_line, | 8357 record_unwind_protect (unwind_format_mode_line, |
8358 format_mode_line_unwind_data (current_buffer)); | 8358 format_mode_line_unwind_data (current_buffer)); |
8359 | 8359 |
8360 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); | 8360 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); |
8361 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; | 8361 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; |
15670 enum face_id face_id; | 15670 enum face_id face_id; |
15671 Lisp_Object format; | 15671 Lisp_Object format; |
15672 { | 15672 { |
15673 struct it it; | 15673 struct it it; |
15674 struct face *face; | 15674 struct face *face; |
15675 int count = SPECPDL_INDEX (); | |
15675 | 15676 |
15676 init_iterator (&it, w, -1, -1, NULL, face_id); | 15677 init_iterator (&it, w, -1, -1, NULL, face_id); |
15677 prepare_desired_row (it.glyph_row); | 15678 prepare_desired_row (it.glyph_row); |
15678 | 15679 |
15679 it.glyph_row->mode_line_p = 1; | 15680 it.glyph_row->mode_line_p = 1; |
15680 | 15681 |
15681 if (! mode_line_inverse_video) | 15682 if (! mode_line_inverse_video) |
15682 /* Force the mode-line to be displayed in the default face. */ | 15683 /* Force the mode-line to be displayed in the default face. */ |
15683 it.base_face_id = it.face_id = DEFAULT_FACE_ID; | 15684 it.base_face_id = it.face_id = DEFAULT_FACE_ID; |
15685 | |
15686 record_unwind_protect (unwind_format_mode_line, | |
15687 format_mode_line_unwind_data (NULL)); | |
15688 | |
15689 mode_line_target = MODE_LINE_DISPLAY; | |
15684 | 15690 |
15685 /* Temporarily make frame's keyboard the current kboard so that | 15691 /* Temporarily make frame's keyboard the current kboard so that |
15686 kboard-local variables in the mode_line_format will get the right | 15692 kboard-local variables in the mode_line_format will get the right |
15687 values. */ | 15693 values. */ |
15688 push_frame_kboard (it.f); | 15694 push_frame_kboard (it.f); |
15689 display_mode_element (&it, 0, 0, 0, format, Qnil, 0); | 15695 display_mode_element (&it, 0, 0, 0, format, Qnil, 0); |
15690 pop_frame_kboard (); | 15696 pop_frame_kboard (); |
15697 | |
15698 unbind_to (count, Qnil); | |
15691 | 15699 |
15692 /* Fill up with spaces. */ | 15700 /* Fill up with spaces. */ |
15693 display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); | 15701 display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); |
15694 | 15702 |
15695 compute_line_metrics (&it); | 15703 compute_line_metrics (&it); |