# HG changeset patch # User Richard M. Stallman # Date 814317376 0 # Node ID d6bba071525c7d3caf3376c89675478efba6e3c1 # Parent dbc038e66ea6b9cf442cbc60871881cf6a7e09f8 (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. diff -r dbc038e66ea6 -r d6bba071525c src/xdisp.c --- a/src/xdisp.c Sat Oct 21 23:15:21 1995 +0000 +++ b/src/xdisp.c Sat Oct 21 23:16:16 1995 +0000 @@ -50,6 +50,7 @@ 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 @@ { 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 @@ { if (pos >= pause) { + int e_t_h; + while (pos == next_boundary) { Lisp_Object position, limit, prop, ww; @@ -2707,6 +2710,27 @@ &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 @@ 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 @@ 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;