aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-06-09 01:54:48 +0000
committerRichard M. Stallman1998-06-09 01:54:48 +0000
commit5936754e60c9c92c46d353e4c7b32a424bffdc60 (patch)
treec3a8118a6b5e42d9e64c3eb3f87a0b9d7256f043 /src
parentf6cfd0b0c53340b527c215ca7de580d6925fea2c (diff)
downloademacs-5936754e60c9c92c46d353e4c7b32a424bffdc60.tar.gz
emacs-5936754e60c9c92c46d353e4c7b32a424bffdc60.zip
(redisplay_internal): If cursor's in the frame's echo area,
make last_point invalid instead of setting it normally. (display_text_line): If cursor's in the frame's echo area, don't set this_line_endpos. (redisplay_window): Use Fwindow_end to find lower scroll margin.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c56
1 files changed, 37 insertions, 19 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 2532c4447eb..4b87ffba4a9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1430,9 +1430,20 @@ update:
1430 beg_unchanged = BUF_GPT (b) - BUF_BEG (b); 1430 beg_unchanged = BUF_GPT (b) - BUF_BEG (b);
1431 end_unchanged = BUF_Z (b) - BUF_GPT (b); 1431 end_unchanged = BUF_Z (b) - BUF_GPT (b);
1432 1432
1433 XSETFASTINT (w->last_point, BUF_PT (b)); 1433 /* Record the last place cursor was displayed in this window.
1434 XSETFASTINT (w->last_point_x, FRAME_CURSOR_X (selected_frame)); 1434 But not if cursor is in the echo area, because in that case
1435 XSETFASTINT (w->last_point_y, FRAME_CURSOR_Y (selected_frame)); 1435 FRAME_CURSOR_X and FRAME_CURSOR_Y are in the echo area. */
1436 if (!(cursor_in_echo_area && FRAME_HAS_MINIBUF_P (selected_frame)
1437 && EQ (FRAME_MINIBUF_WINDOW (selected_frame), minibuf_window)))
1438 {
1439 XSETFASTINT (w->last_point, BUF_PT (b));
1440 XSETFASTINT (w->last_point_x, FRAME_CURSOR_X (selected_frame));
1441 XSETFASTINT (w->last_point_y, FRAME_CURSOR_Y (selected_frame));
1442 }
1443 else
1444 /* Make last_point invalid, since we don't really know
1445 where the cursor would be if it were not in the echo area. */
1446 XSETINT (w->last_point, -1);
1436 1447
1437 if (all_windows) 1448 if (all_windows)
1438 mark_window_display_accurate (FRAME_ROOT_WINDOW (selected_frame), 1); 1449 mark_window_display_accurate (FRAME_ROOT_WINDOW (selected_frame), 1);
@@ -2214,6 +2225,8 @@ redisplay_window (window, just_this_one, preserve_echo_area)
2214 int this_scroll_margin = scroll_margin; 2225 int this_scroll_margin = scroll_margin;
2215 int scroll_margin_pos, scroll_margin_bytepos; 2226 int scroll_margin_pos, scroll_margin_bytepos;
2216 int scroll_max = scroll_step; 2227 int scroll_max = scroll_step;
2228 Lisp_Object ltemp;
2229
2217 if (scroll_conservatively) 2230 if (scroll_conservatively)
2218 scroll_max = scroll_conservatively; 2231 scroll_max = scroll_conservatively;
2219 2232
@@ -2224,7 +2237,9 @@ redisplay_window (window, just_this_one, preserve_echo_area)
2224 if (XINT (w->height) < 4 * this_scroll_margin) 2237 if (XINT (w->height) < 4 * this_scroll_margin)
2225 this_scroll_margin = XINT (w->height) / 4; 2238 this_scroll_margin = XINT (w->height) / 4;
2226 2239
2227 scroll_margin_pos = Z - XFASTINT (w->window_end_pos); 2240 ltemp = Fwindow_end (window, Qt);
2241 scroll_margin_pos = XINT (ltemp);
2242
2228 if (this_scroll_margin) 2243 if (this_scroll_margin)
2229 { 2244 {
2230 pos = *vmotion (scroll_margin_pos, -this_scroll_margin, w); 2245 pos = *vmotion (scroll_margin_pos, -this_scroll_margin, w);
@@ -4001,29 +4016,32 @@ display_text_line (w, start, start_byte, vpos, hpos, taboffset, ovstr_done)
4001 cursor_hpos += WINDOW_LEFT_MARGIN (w); 4016 cursor_hpos += WINDOW_LEFT_MARGIN (w);
4002 if (w == XWINDOW (FRAME_SELECTED_WINDOW (f))) 4017 if (w == XWINDOW (FRAME_SELECTED_WINDOW (f)))
4003 { 4018 {
4019 this_line_bufpos = 0;
4020
4021 /* If this frame's cursor will be in its echo area,
4022 don't record a cursor from the window text,
4023 and turn off the optimization for cursor-motion-only case. */
4004 if (!(cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) 4024 if (!(cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f)
4005 && EQ (FRAME_MINIBUF_WINDOW (f), minibuf_window))) 4025 && EQ (FRAME_MINIBUF_WINDOW (f), minibuf_window)))
4006 { 4026 {
4007 FRAME_CURSOR_Y (f) = cursor_vpos; 4027 FRAME_CURSOR_Y (f) = cursor_vpos;
4008 FRAME_CURSOR_X (f) = cursor_hpos; 4028 FRAME_CURSOR_X (f) = cursor_hpos;
4009 }
4010 4029
4011 if (w == XWINDOW (selected_window)) 4030 if (w == XWINDOW (selected_window))
4012 {
4013 /* Line is not continued and did not start
4014 in middle of character */
4015 if ((hpos - WINDOW_LEFT_MARGIN (w)
4016 == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0))
4017 && val.vpos)
4018 { 4031 {
4019 this_line_bufpos = start; 4032 /* Line is not continued and did not start
4020 this_line_buffer = current_buffer; 4033 in middle of character */
4021 this_line_vpos = cursor_vpos; 4034 if ((hpos - WINDOW_LEFT_MARGIN (w)
4022 this_line_start_hpos = hpos - WINDOW_LEFT_MARGIN (w); 4035 == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0))
4023 this_line_endpos = Z - lastpos; 4036 && val.vpos)
4037 {
4038 this_line_bufpos = start;
4039 this_line_buffer = current_buffer;
4040 this_line_vpos = cursor_vpos;
4041 this_line_start_hpos = hpos - WINDOW_LEFT_MARGIN (w);
4042 this_line_endpos = Z - lastpos;
4043 }
4024 } 4044 }
4025 else
4026 this_line_bufpos = 0;
4027 } 4045 }
4028 } 4046 }
4029 } 4047 }