From 67481ae554117a577d89f1a916e62927df18ac40 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Oct 1995 23:16:16 +0000 Subject: [PATCH] (try_window_id): Stop the compute_motion at ZV, not Z, when checking if all changes are below the window. (Qredisplay_end_trigger_hook): New variable. (syms_of_xdisp): Set up Lisp variable. (display_text_line): Run the hook when appropriate. --- src/xdisp.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 0978787947d..7014219d59c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -50,6 +50,7 @@ extern Lisp_Object Voverriding_local_map_menu_flag; Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; +Lisp_Object Qredisplay_end_trigger_hook; /* Nonzero means print newline to stdout before next minibuffer message. */ @@ -1911,12 +1912,12 @@ try_window_id (window) { if (PT < bp.bufpos) { - /* All changes are below the frame, and point is on the frame. - We don't need to change the frame at all. + /* All changes are beyond the window end, and point is on the screen. + We don't need to change the text at all. But we need to update window_end_pos to account for any change in buffer size. */ bp = *compute_motion (start, 0, lmargin, 0, - Z, height, 0, + ZV, height, 0, width, hscroll, pos_tab_offset (w, start), w); XSETFASTINT (w->window_end_vpos, height); XSETFASTINT (w->window_end_pos, Z - bp.bufpos); @@ -2616,6 +2617,8 @@ display_text_line (w, start, vpos, hpos, taboffset) { if (pos >= pause) { + int e_t_h; + while (pos == next_boundary) { Lisp_Object position, limit, prop, ww; @@ -2707,6 +2710,27 @@ display_text_line (w, start, vpos, hpos, taboffset) &next_face_change, pos + 50, 0); #endif + /* Figure out where (if at all) the + redisplay_end_trigger-hook should run. */ + if (MARKERP (current_buffer->redisplay_end_trigger)) + e_t_h = marker_position (current_buffer->redisplay_end_trigger); + else if (INTEGERP (current_buffer->redisplay_end_trigger)) + e_t_h = XINT (current_buffer->redisplay_end_trigger); + else + e_t_h = ZV; + + /* If we've gone past the place to run a hook, + run the hook. */ + if (pos >= e_t_h && e_t_h != ZV) + { + call1 (Vrun_hooks, Qredisplay_end_trigger_hook); + current_buffer->redisplay_end_trigger = Qnil; + e_t_h = ZV; + } + + /* Compute the next place we need to stop + and do something special; set PAUSE. */ + pause = ZV; if (pos < next_boundary && next_boundary < pause) @@ -2714,6 +2738,9 @@ display_text_line (w, start, vpos, hpos, taboffset) if (pos < next_face_change && next_face_change < pause) pause = next_face_change; + if (e_t_h < pause) + pause = e_t_h; + /* Wouldn't you hate to read the next line to someone over the phone? */ if (pos < PT && PT < pause) @@ -4202,6 +4229,9 @@ syms_of_xdisp () staticpro (&Qwindow_scroll_functions); Qwindow_scroll_functions = intern ("window-scroll-functions"); + staticpro (&Qredisplay_end_trigger_hook); + Qredisplay_end_trigger_hook = intern ("redisplay-end-trigger-hook"); + staticpro (&last_arrow_position); staticpro (&last_arrow_string); last_arrow_position = Qnil; -- 2.39.2