comparison src/xdisp.c @ 25388:b38732c75a65

(redisplay_window): Don't ever test just_this_one_p before calling try_window. (echo_area_display): If height has changed, update other windows. (resize_mini_frame, resize_mini_initial_height): New. (resize_mini_window): Save/restore window configuration differently.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 24 Aug 1999 19:24:57 +0000
parents d32d09a601e8
children 9aff86718a20
comparison
equal deleted inserted replaced
25387:df0083768b79 25388:b38732c75a65
479 479
480 static Lisp_Object Vmax_mini_window_height; 480 static Lisp_Object Vmax_mini_window_height;
481 481
482 /* Window configuration saved in resize_mini_window. */ 482 /* Window configuration saved in resize_mini_window. */
483 483
484 static Lisp_Object Vresize_mini_config; 484 Lisp_Object Vresize_mini_config;
485
486 /* Frmae of the mini-window being resized by resize_mini_window. */
487
488 struct frame *resize_mini_frame;
489
490 /* Initial height of the mini-window having been resized
491 by resize_mini_window. */
492
493 int resize_mini_initial_height;
485 494
486 /* A scratch glyph row with contents used for generating truncation 495 /* A scratch glyph row with contents used for generating truncation
487 glyphs. Also used in direct_output_for_insert. */ 496 glyphs. Also used in direct_output_for_insert. */
488 497
489 #define MAX_SCRATCH_GLYPHS 100 498 #define MAX_SCRATCH_GLYPHS 100
5454 start = it.current.pos; 5463 start = it.current.pos;
5455 } 5464 }
5456 else 5465 else
5457 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 5466 SET_TEXT_POS (start, BEGV, BEGV_BYTE);
5458 SET_MARKER_FROM_TEXT_POS (w->start, start); 5467 SET_MARKER_FROM_TEXT_POS (w->start, start);
5459 5468
5460 /* Change window's height, if necessary. */ 5469 if (NILP (Vresize_mini_config))
5461 if (height > XFASTINT (w->height) 5470 {
5462 || (height < XFASTINT (w->height) 5471 if (height != XFASTINT (w->height))
5463 && NILP (Vresize_mini_config))) 5472 {
5464 { 5473 Lisp_Object old_selected_window;
5465 Lisp_Object old_selected_window; 5474 Lisp_Object config;
5466 5475 struct gcpro gcpro1;
5467 if (NILP (Vresize_mini_config)) 5476
5468 Vresize_mini_config = Fcurrent_window_configuration (Qnil); 5477 resize_mini_initial_height = XFASTINT (w->height);
5469 5478 config = Fcurrent_window_configuration (Qnil);
5470 old_selected_window = selected_window; 5479 GCPRO1 (config);
5471 XSETWINDOW (selected_window, w); 5480
5472 change_window_height (height - XFASTINT (w->height), 0); 5481 old_selected_window = selected_window;
5473 selected_window = old_selected_window; 5482 XSETWINDOW (selected_window, w);
5474 window_height_changed_p = 1; 5483 change_window_height (height - XFASTINT (w->height), 0);
5475 } 5484 selected_window = old_selected_window;
5476 else if (height < XFASTINT (w->height) 5485
5477 && !NILP (Vresize_mini_config)) 5486 window_height_changed_p = 1;
5478 { 5487
5479 Fset_window_configuration (Vresize_mini_config); 5488 /* Set this after changing window sizes, or else
5480 Vresize_mini_config = Qnil; 5489 Vresize_mini_config would be reset in
5490 adjust_frame_glyphs. */
5491 resize_mini_frame = XFRAME (w->frame);
5492 Vresize_mini_config = config;
5493 UNGCPRO;
5494 }
5495 }
5496 else if (height != XFASTINT (w->height))
5497 {
5498 if (height == resize_mini_initial_height)
5499 {
5500 Fset_window_configuration (Vresize_mini_config);
5501 Vresize_mini_config = Qnil;
5502 resize_mini_frame = NULL;
5503 }
5504 else
5505 {
5506 Lisp_Object old_selected_window;
5507 old_selected_window = selected_window;
5508 XSETWINDOW (selected_window, w);
5509 change_window_height (height - XFASTINT (w->height), 0);
5510 selected_window = old_selected_window;
5511 }
5512
5481 window_height_changed_p = 1; 5513 window_height_changed_p = 1;
5482 } 5514 }
5483 } 5515 }
5484 5516
5485 return window_height_changed_p; 5517 return window_height_changed_p;
5797 if (!NILP (echo_area_buffer[0]) || minibuf_level == 0) 5829 if (!NILP (echo_area_buffer[0]) || minibuf_level == 0)
5798 { 5830 {
5799 echo_area_window = mini_window; 5831 echo_area_window = mini_window;
5800 window_height_changed_p = display_echo_area (w); 5832 window_height_changed_p = display_echo_area (w);
5801 w->must_be_updated_p = 1; 5833 w->must_be_updated_p = 1;
5802 5834
5803 if (update_frame_p) 5835 if (update_frame_p)
5804 { 5836 {
5805 /* Calling update_single_window is faster when we can use 5837 /* Not called from redisplay_internal. If we changed
5806 window-based redisplay. */ 5838 window configuration, we must redisplay thoroughly.
5807 if (FRAME_WINDOW_P (f)) 5839 Otherwise, we can do with updating what we displayed
5840 above. */
5841 if (window_height_changed_p)
5842 {
5843 ++windows_or_buffers_changed;
5844 ++update_mode_lines;
5845 redisplay_internal (0);
5846 }
5847 else if (FRAME_WINDOW_P (f))
5808 { 5848 {
5809 update_single_window (w, 1); 5849 update_single_window (w, 1);
5810 rif->flush_display (f); 5850 rif->flush_display (f);
5811 } 5851 }
5812 else 5852 else
5813 update_frame (f, 1, 1); 5853 update_frame (f, 1, 1);
5814 } 5854 }
5815 } 5855 }
5816 else if (!EQ (mini_window, selected_window)) 5856 else if (!EQ (mini_window, selected_window))
5817 windows_or_buffers_changed++; 5857 windows_or_buffers_changed++;
5818 5858
5859 /* Last displayed message is now the current message. */
5819 echo_area_buffer[1] = echo_area_buffer[0]; 5860 echo_area_buffer[1] = echo_area_buffer[0];
5820 5861
5821 /* Prevent redisplay optimization in redisplay_internal by resetting 5862 /* Prevent redisplay optimization in redisplay_internal by resetting
5822 this_line_start_pos. This is done because the mini-buffer now 5863 this_line_start_pos. This is done because the mini-buffer now
5823 displays the message instead of its buffer text. */ 5864 displays the message instead of its buffer text. */
8605 else if (/* Windows and buffers haven't changed. */ 8646 else if (/* Windows and buffers haven't changed. */
8606 !windows_or_buffers_changed 8647 !windows_or_buffers_changed
8607 /* Window must be either use window-based redisplay or 8648 /* Window must be either use window-based redisplay or
8608 be full width. */ 8649 be full width. */
8609 && (FRAME_WINDOW_P (f) 8650 && (FRAME_WINDOW_P (f)
8610 || ((line_ins_del_ok && WINDOW_FULL_WIDTH_P (w)) 8651 || (line_ins_del_ok && WINDOW_FULL_WIDTH_P (w)))
8611 && just_this_one_p))
8612 && !MINI_WINDOW_P (w) 8652 && !MINI_WINDOW_P (w)
8613 /* Point is not known NOT to appear in window. */ 8653 /* Point is not known NOT to appear in window. */
8614 && PT >= CHARPOS (startp) 8654 && PT >= CHARPOS (startp)
8615 && XFASTINT (w->last_modified) 8655 && XFASTINT (w->last_modified)
8616 /* Window is not hscrolled. */ 8656 /* Window is not hscrolled. */
9493 9533
9494 9534
9495 /* Find the first glyph row in the current matrix of W that is not 9535 /* Find the first glyph row in the current matrix of W that is not
9496 affected by changes at the end of current_buffer since the last 9536 affected by changes at the end of current_buffer since the last
9497 time the window was redisplayed. Return in *DELTA the number of 9537 time the window was redisplayed. Return in *DELTA the number of
9498 bytes by which buffer positions in unchanged text at the end of 9538 chars by which buffer positions in unchanged text at the end of
9499 current_buffer must be adjusted. Value is null if no such row 9539 current_buffer must be adjusted. Return in *DELTA_BYTES the
9500 exists, i.e. all rows are affected by changes. 9540 corresponding number of bytes. Value is null if no such row
9501 9541 exists, i.e. all rows are affected by changes. */
9502 The global variable end_unchanged is assumed to contain the number
9503 of unchanged bytes at the end of current_buffer. The buffer
9504 position of the last changed byte in current_buffer is then Z -
9505 end_unchanged. */
9506 9542
9507 static struct glyph_row * 9543 static struct glyph_row *
9508 get_first_unchanged_at_end_row (w, delta, delta_bytes) 9544 get_first_unchanged_at_end_row (w, delta, delta_bytes)
9509 struct window *w; 9545 struct window *w;
9510 int *delta, *delta_bytes; 9546 int *delta, *delta_bytes;