aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2005-08-20 05:26:27 +0000
committerRichard M. Stallman2005-08-20 05:26:27 +0000
commit40b388f98ce27057cff72ff65fc3ee91a2e7344d (patch)
treeac40c0282365d83d75256a95dc844991b0e9f51e /src
parent6a7df22fdb508a944417455238b7714ada78d8b4 (diff)
downloademacs-40b388f98ce27057cff72ff65fc3ee91a2e7344d.tar.gz
emacs-40b388f98ce27057cff72ff65fc3ee91a2e7344d.zip
(display_echo_area_1): Get display start pos from w->start.
(resize_mini_window): Set w->start, and PT, so as to display the tail end of the buffer, if it doesn't all fit.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c25
2 files changed, 26 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d568243a0e7..7bc84cfbdbf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12005-08-20 Richard M. Stallman <rms@gnu.org>
2
3 * xdisp.c (display_echo_area_1): Get display start pos from w->start.
4 (resize_mini_window): Set w->start, and PT, so as to display the tail
5 end of the buffer, if it doesn't all fit.
6
12005-08-18 Kim F. Storm <storm@cua.dk> 72005-08-18 Kim F. Storm <storm@cua.dk>
2 8
3 * xdisp.c (calc_pixel_width_or_height): Use actual display 9 * xdisp.c (calc_pixel_width_or_height): Use actual display
diff --git a/src/xdisp.c b/src/xdisp.c
index 6ed5fd151d6..3a4f3f001ab 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7631,13 +7631,16 @@ display_echo_area_1 (a1, a2, a3, a4)
7631 int window_height_changed_p = 0; 7631 int window_height_changed_p = 0;
7632 7632
7633 /* Do this before displaying, so that we have a large enough glyph 7633 /* Do this before displaying, so that we have a large enough glyph
7634 matrix for the display. */ 7634 matrix for the display. If we can't get enough space for the
7635 whole text, display the last N lines. That works by setting w->start. */
7635 window_height_changed_p = resize_mini_window (w, 0); 7636 window_height_changed_p = resize_mini_window (w, 0);
7636 7637
7638 /* Use the starting position chosen by resize_mini_window. */
7639 SET_TEXT_POS_FROM_MARKER (start, w->start);
7640
7637 /* Display. */ 7641 /* Display. */
7638 clear_glyph_matrix (w->desired_matrix); 7642 clear_glyph_matrix (w->desired_matrix);
7639 XSETWINDOW (window, w); 7643 XSETWINDOW (window, w);
7640 SET_TEXT_POS (start, BEG, BEG_BYTE);
7641 try_window (window, start, 0); 7644 try_window (window, start, 0);
7642 7645
7643 return window_height_changed_p; 7646 return window_height_changed_p;
@@ -7693,8 +7696,14 @@ resize_mini_window_1 (a1, exactly, a3, a4)
7693 7696
7694/* Resize mini-window W to fit the size of its contents. EXACT:P 7697/* Resize mini-window W to fit the size of its contents. EXACT:P
7695 means size the window exactly to the size needed. Otherwise, it's 7698 means size the window exactly to the size needed. Otherwise, it's
7696 only enlarged until W's buffer is empty. Value is non-zero if 7699 only enlarged until W's buffer is empty.
7697 the window height has been changed. */ 7700
7701 Set W->start to the right place to begin display. If the whole
7702 contents fit, start at the beginning. Otherwise, start so as
7703 to make the end of the contents appear. This is particularly
7704 important for y-or-n-p, but seems desirable generally.
7705
7706 Value is non-zero if the window height has been changed. */
7698 7707
7699int 7708int
7700resize_mini_window (w, exact_p) 7709resize_mini_window (w, exact_p)
@@ -7706,6 +7715,11 @@ resize_mini_window (w, exact_p)
7706 7715
7707 xassert (MINI_WINDOW_P (w)); 7716 xassert (MINI_WINDOW_P (w));
7708 7717
7718 /* By default, start display at the beginning. */
7719 set_marker_both (w->start, w->buffer,
7720 BUF_BEGV (XBUFFER (w->buffer)),
7721 BUF_BEGV_BYTE (XBUFFER (w->buffer)));
7722
7709 /* Don't resize windows while redisplaying a window; it would 7723 /* Don't resize windows while redisplaying a window; it would
7710 confuse redisplay functions when the size of the window they are 7724 confuse redisplay functions when the size of the window they are
7711 displaying changes from under them. Such a resizing can happen, 7725 displaying changes from under them. Such a resizing can happen,
@@ -7769,9 +7783,10 @@ resize_mini_window (w, exact_p)
7769 if (height > max_height) 7783 if (height > max_height)
7770 { 7784 {
7771 height = max_height; 7785 height = max_height;
7772 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 7786 init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
7773 move_it_vertically_backward (&it, (height - 1) * unit); 7787 move_it_vertically_backward (&it, (height - 1) * unit);
7774 start = it.current.pos; 7788 start = it.current.pos;
7789 SET_PT_BOTH (CHARPOS (start), BYTEPOS (start));
7775 } 7790 }
7776 else 7791 else
7777 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 7792 SET_TEXT_POS (start, BEGV, BEGV_BYTE);