diff options
| author | Richard M. Stallman | 1995-10-21 23:16:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-21 23:16:16 +0000 |
| commit | 67481ae554117a577d89f1a916e62927df18ac40 (patch) | |
| tree | 1749cfc846aca0bbab9d48194ffbbd9ef91c9c5e /src | |
| parent | 44214c1bc80d73bc461051df98f84dbac2c02313 (diff) | |
| download | emacs-67481ae554117a577d89f1a916e62927df18ac40.tar.gz emacs-67481ae554117a577d89f1a916e62927df18ac40.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 36 |
1 files 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; | |||
| 50 | 50 | ||
| 51 | Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; | 51 | Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; |
| 52 | Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; | 52 | Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; |
| 53 | Lisp_Object Qredisplay_end_trigger_hook; | ||
| 53 | 54 | ||
| 54 | /* Nonzero means print newline to stdout before next minibuffer message. */ | 55 | /* Nonzero means print newline to stdout before next minibuffer message. */ |
| 55 | 56 | ||
| @@ -1911,12 +1912,12 @@ try_window_id (window) | |||
| 1911 | { | 1912 | { |
| 1912 | if (PT < bp.bufpos) | 1913 | if (PT < bp.bufpos) |
| 1913 | { | 1914 | { |
| 1914 | /* All changes are below the frame, and point is on the frame. | 1915 | /* All changes are beyond the window end, and point is on the screen. |
| 1915 | We don't need to change the frame at all. | 1916 | We don't need to change the text at all. |
| 1916 | But we need to update window_end_pos to account for | 1917 | But we need to update window_end_pos to account for |
| 1917 | any change in buffer size. */ | 1918 | any change in buffer size. */ |
| 1918 | bp = *compute_motion (start, 0, lmargin, 0, | 1919 | bp = *compute_motion (start, 0, lmargin, 0, |
| 1919 | Z, height, 0, | 1920 | ZV, height, 0, |
| 1920 | width, hscroll, pos_tab_offset (w, start), w); | 1921 | width, hscroll, pos_tab_offset (w, start), w); |
| 1921 | XSETFASTINT (w->window_end_vpos, height); | 1922 | XSETFASTINT (w->window_end_vpos, height); |
| 1922 | XSETFASTINT (w->window_end_pos, Z - bp.bufpos); | 1923 | XSETFASTINT (w->window_end_pos, Z - bp.bufpos); |
| @@ -2616,6 +2617,8 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 2616 | { | 2617 | { |
| 2617 | if (pos >= pause) | 2618 | if (pos >= pause) |
| 2618 | { | 2619 | { |
| 2620 | int e_t_h; | ||
| 2621 | |||
| 2619 | while (pos == next_boundary) | 2622 | while (pos == next_boundary) |
| 2620 | { | 2623 | { |
| 2621 | Lisp_Object position, limit, prop, ww; | 2624 | Lisp_Object position, limit, prop, ww; |
| @@ -2707,6 +2710,27 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 2707 | &next_face_change, pos + 50, 0); | 2710 | &next_face_change, pos + 50, 0); |
| 2708 | #endif | 2711 | #endif |
| 2709 | 2712 | ||
| 2713 | /* Figure out where (if at all) the | ||
| 2714 | redisplay_end_trigger-hook should run. */ | ||
| 2715 | if (MARKERP (current_buffer->redisplay_end_trigger)) | ||
| 2716 | e_t_h = marker_position (current_buffer->redisplay_end_trigger); | ||
| 2717 | else if (INTEGERP (current_buffer->redisplay_end_trigger)) | ||
| 2718 | e_t_h = XINT (current_buffer->redisplay_end_trigger); | ||
| 2719 | else | ||
| 2720 | e_t_h = ZV; | ||
| 2721 | |||
| 2722 | /* If we've gone past the place to run a hook, | ||
| 2723 | run the hook. */ | ||
| 2724 | if (pos >= e_t_h && e_t_h != ZV) | ||
| 2725 | { | ||
| 2726 | call1 (Vrun_hooks, Qredisplay_end_trigger_hook); | ||
| 2727 | current_buffer->redisplay_end_trigger = Qnil; | ||
| 2728 | e_t_h = ZV; | ||
| 2729 | } | ||
| 2730 | |||
| 2731 | /* Compute the next place we need to stop | ||
| 2732 | and do something special; set PAUSE. */ | ||
| 2733 | |||
| 2710 | pause = ZV; | 2734 | pause = ZV; |
| 2711 | 2735 | ||
| 2712 | if (pos < next_boundary && next_boundary < pause) | 2736 | if (pos < next_boundary && next_boundary < pause) |
| @@ -2714,6 +2738,9 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 2714 | if (pos < next_face_change && next_face_change < pause) | 2738 | if (pos < next_face_change && next_face_change < pause) |
| 2715 | pause = next_face_change; | 2739 | pause = next_face_change; |
| 2716 | 2740 | ||
| 2741 | if (e_t_h < pause) | ||
| 2742 | pause = e_t_h; | ||
| 2743 | |||
| 2717 | /* Wouldn't you hate to read the next line to someone over | 2744 | /* Wouldn't you hate to read the next line to someone over |
| 2718 | the phone? */ | 2745 | the phone? */ |
| 2719 | if (pos < PT && PT < pause) | 2746 | if (pos < PT && PT < pause) |
| @@ -4202,6 +4229,9 @@ syms_of_xdisp () | |||
| 4202 | staticpro (&Qwindow_scroll_functions); | 4229 | staticpro (&Qwindow_scroll_functions); |
| 4203 | Qwindow_scroll_functions = intern ("window-scroll-functions"); | 4230 | Qwindow_scroll_functions = intern ("window-scroll-functions"); |
| 4204 | 4231 | ||
| 4232 | staticpro (&Qredisplay_end_trigger_hook); | ||
| 4233 | Qredisplay_end_trigger_hook = intern ("redisplay-end-trigger-hook"); | ||
| 4234 | |||
| 4205 | staticpro (&last_arrow_position); | 4235 | staticpro (&last_arrow_position); |
| 4206 | staticpro (&last_arrow_string); | 4236 | staticpro (&last_arrow_string); |
| 4207 | last_arrow_position = Qnil; | 4237 | last_arrow_position = Qnil; |