diff options
| author | Gerd Moellmann | 2001-03-23 17:20:52 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-23 17:20:52 +0000 |
| commit | 43c099691aa057b934b8d4c1008477a881fd6b3d (patch) | |
| tree | 9db8c26b58052139e2a3d93180165500b1207527 /src | |
| parent | ac90c44f600318090df0f111005dc06f005c8e10 (diff) | |
| download | emacs-43c099691aa057b934b8d4c1008477a881fd6b3d.tar.gz emacs-43c099691aa057b934b8d4c1008477a881fd6b3d.zip | |
(mark_window_display_accurate_1): New function,
extracted from mark_window_display_accurate. Compute
BUF_UNCHANGED_MODIFIED, BUF_OVERLAY_UNCHANGED_MODIFIED,
BUF_BEG_UNCHANGED, BUF_END_UNCHANGED.
(mark_window_display_accurate): Use it.
(redisplay_internal): Use it for the selected window.
(redisplay_internal): Avoid duplicate mark_window_display_accurate
for the selected frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/xdisp.c | 155 |
2 files changed, 74 insertions, 92 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c416942165e..0f907bff031 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2001-03-23 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-03-23 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (mark_window_display_accurate_1): New function, | ||
| 4 | extracted from mark_window_display_accurate. Compute | ||
| 5 | BUF_UNCHANGED_MODIFIED, BUF_OVERLAY_UNCHANGED_MODIFIED, | ||
| 6 | BUF_BEG_UNCHANGED, BUF_END_UNCHANGED. | ||
| 7 | (mark_window_display_accurate): Use it. | ||
| 8 | (redisplay_internal): Use it for the selected window. | ||
| 9 | (redisplay_internal): Avoid duplicate mark_window_display_accurate | ||
| 10 | for the selected frame. | ||
| 11 | |||
| 3 | * xdisp.c Use make_number, for readability. | 12 | * xdisp.c Use make_number, for readability. |
| 4 | (try_window_id): Disable rows below the window end. | 13 | (try_window_id): Disable rows below the window end. |
| 5 | (try_window_reusing_current_matrix): Use cursor_row_p. | 14 | (try_window_reusing_current_matrix): Use cursor_row_p. |
| @@ -7,7 +16,7 @@ | |||
| 7 | of rows. | 16 | of rows. |
| 8 | (init_from_display_pos): If POS specifies a position in a display | 17 | (init_from_display_pos): If POS specifies a position in a display |
| 9 | vector, maybe get the iterator set up for that ellipsis. | 18 | vector, maybe get the iterator set up for that ellipsis. |
| 10 | 19 | ||
| 11 | * xdisp.c (dump_glyph_row): Fix output for NGLYPHS == 2. | 20 | * xdisp.c (dump_glyph_row): Fix output for NGLYPHS == 2. |
| 12 | 21 | ||
| 13 | 2001-03-23 Eli Zaretskii <eliz@is.elta.co.il> | 22 | 2001-03-23 Eli Zaretskii <eliz@is.elta.co.il> |
diff --git a/src/xdisp.c b/src/xdisp.c index f1a66b42da5..f467ef9671d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -654,6 +654,7 @@ enum move_it_result | |||
| 654 | 654 | ||
| 655 | /* Function prototypes. */ | 655 | /* Function prototypes. */ |
| 656 | 656 | ||
| 657 | static void mark_window_display_accurate_1 P_ ((struct window *, int)); | ||
| 657 | static int single_display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); | 658 | static int single_display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); |
| 658 | static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); | 659 | static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); |
| 659 | static int cursor_row_p P_ ((struct window *, struct glyph_row *)); | 660 | static int cursor_row_p P_ ((struct window *, struct glyph_row *)); |
| @@ -8709,54 +8710,15 @@ redisplay_internal (preserve_echo_area) | |||
| 8709 | && !FRAME_WINDOW_P (XFRAME (w->frame))) | 8710 | && !FRAME_WINDOW_P (XFRAME (w->frame))) |
| 8710 | update_mode_lines = 1; | 8711 | update_mode_lines = 1; |
| 8711 | } | 8712 | } |
| 8712 | 8713 | else | |
| 8713 | /* Now text on frame agrees with windows, so put info into the | ||
| 8714 | windows for partial redisplay to follow. */ | ||
| 8715 | if (!pause) | ||
| 8716 | { | 8714 | { |
| 8717 | register struct buffer *b = XBUFFER (w->buffer); | 8715 | if (!consider_all_windows_p) |
| 8718 | |||
| 8719 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); | ||
| 8720 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); | ||
| 8721 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); | ||
| 8722 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); | ||
| 8723 | |||
| 8724 | if (consider_all_windows_p) | ||
| 8725 | mark_window_display_accurate (FRAME_ROOT_WINDOW (sf), 1); | ||
| 8726 | else | ||
| 8727 | { | 8716 | { |
| 8728 | w->last_point = make_number (BUF_PT (b)); | 8717 | /* This has already been done above if |
| 8729 | w->last_cursor = w->cursor; | 8718 | consider_all_windows_p is set. */ |
| 8730 | w->last_cursor_off_p = w->cursor_off_p; | 8719 | mark_window_display_accurate_1 (w, 1); |
| 8731 | |||
| 8732 | b->clip_changed = 0; | ||
| 8733 | b->prevent_redisplay_optimizations_p = 0; | ||
| 8734 | w->update_mode_line = Qnil; | ||
| 8735 | w->last_modified = make_number (BUF_MODIFF (b)); | ||
| 8736 | w->last_overlay_modified = make_number (BUF_OVERLAY_MODIFF (b)); | ||
| 8737 | w->last_had_star | ||
| 8738 | = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer)) | ||
| 8739 | ? Qt : Qnil); | ||
| 8740 | |||
| 8741 | /* Record if we are showing a region, so can make sure to | ||
| 8742 | update it fully at next redisplay. */ | ||
| 8743 | w->region_showing = (!NILP (Vtransient_mark_mode) | ||
| 8744 | && (EQ (selected_window, | ||
| 8745 | current_buffer->last_selected_window) | ||
| 8746 | || highlight_nonselected_windows) | ||
| 8747 | && !NILP (XBUFFER (w->buffer)->mark_active) | ||
| 8748 | ? Fmarker_position (XBUFFER (w->buffer)->mark) | ||
| 8749 | : Qnil); | ||
| 8750 | |||
| 8751 | w->window_end_valid = w->buffer; | ||
| 8752 | last_arrow_position = COERCE_MARKER (Voverlay_arrow_position); | ||
| 8753 | last_arrow_string = Voverlay_arrow_string; | ||
| 8754 | if (frame_up_to_date_hook != 0) | 8720 | if (frame_up_to_date_hook != 0) |
| 8755 | (*frame_up_to_date_hook) (sf); | 8721 | frame_up_to_date_hook (sf); |
| 8756 | |||
| 8757 | w->current_matrix->buffer = b; | ||
| 8758 | w->current_matrix->begv = BUF_BEGV (b); | ||
| 8759 | w->current_matrix->zv = BUF_ZV (b); | ||
| 8760 | } | 8722 | } |
| 8761 | 8723 | ||
| 8762 | update_mode_lines = 0; | 8724 | update_mode_lines = 0; |
| @@ -8857,64 +8819,75 @@ unwind_redisplay (old_redisplaying_p) | |||
| 8857 | } | 8819 | } |
| 8858 | 8820 | ||
| 8859 | 8821 | ||
| 8860 | /* Mark the display of windows in the window tree rooted at WINDOW as | 8822 | /* Mark the display of window W as accurate or inaccurate. If |
| 8861 | accurate or inaccurate. If FLAG is non-zero mark display of WINDOW | 8823 | ACCURATE_P is non-zero mark display of W as accurate. If |
| 8862 | as accurate. If FLAG is zero arrange for WINDOW to be redisplayed | 8824 | ACCURATE_P is zero, arrange for W to be redisplayed the next time |
| 8863 | the next time redisplay_internal is called. */ | 8825 | redisplay_internal is called. */ |
| 8864 | 8826 | ||
| 8865 | void | 8827 | static void |
| 8866 | mark_window_display_accurate (window, accurate_p) | 8828 | mark_window_display_accurate_1 (w, accurate_p) |
| 8867 | Lisp_Object window; | 8829 | struct window *w; |
| 8868 | int accurate_p; | 8830 | int accurate_p; |
| 8869 | { | 8831 | { |
| 8870 | struct window *w; | 8832 | if (BUFFERP (w->buffer)) |
| 8871 | |||
| 8872 | for (; !NILP (window); window = w->next) | ||
| 8873 | { | 8833 | { |
| 8874 | w = XWINDOW (window); | 8834 | struct buffer *b = XBUFFER (w->buffer); |
| 8835 | |||
| 8836 | w->last_modified | ||
| 8837 | = make_number (accurate_p ? BUF_MODIFF (b) : 0); | ||
| 8838 | w->last_overlay_modified | ||
| 8839 | = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0); | ||
| 8840 | w->last_had_star | ||
| 8841 | = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b) ? Qt : Qnil; | ||
| 8875 | 8842 | ||
| 8876 | if (BUFFERP (w->buffer)) | 8843 | if (accurate_p) |
| 8877 | { | 8844 | { |
| 8878 | struct buffer *b = XBUFFER (w->buffer); | 8845 | b->clip_changed = 0; |
| 8846 | b->prevent_redisplay_optimizations_p = 0; | ||
| 8847 | |||
| 8848 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); | ||
| 8849 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); | ||
| 8850 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); | ||
| 8851 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); | ||
| 8879 | 8852 | ||
| 8880 | w->last_modified | 8853 | w->current_matrix->buffer = b; |
| 8881 | = make_number (accurate_p ? BUF_MODIFF (b) : 0); | 8854 | w->current_matrix->begv = BUF_BEGV (b); |
| 8882 | w->last_overlay_modified | 8855 | w->current_matrix->zv = BUF_ZV (b); |
| 8883 | = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0); | ||
| 8884 | w->last_had_star = (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b) | ||
| 8885 | ? Qt : Qnil); | ||
| 8886 | |||
| 8887 | #if 0 /* I don't think this is necessary because display_line does it. | ||
| 8888 | Let's check it. */ | ||
| 8889 | /* Record if we are showing a region, so can make sure to | ||
| 8890 | update it fully at next redisplay. */ | ||
| 8891 | w->region_showing | ||
| 8892 | = (!NILP (Vtransient_mark_mode) | ||
| 8893 | && (w == XWINDOW (current_buffer->last_selected_window) | ||
| 8894 | || highlight_nonselected_windows) | ||
| 8895 | && (!NILP (b->mark_active) | ||
| 8896 | ? Fmarker_position (b->mark) | ||
| 8897 | : Qnil)); | ||
| 8898 | #endif | ||
| 8899 | 8856 | ||
| 8900 | if (accurate_p) | 8857 | w->last_cursor = w->cursor; |
| 8901 | { | 8858 | w->last_cursor_off_p = w->cursor_off_p; |
| 8902 | b->clip_changed = 0; | 8859 | |
| 8903 | b->prevent_redisplay_optimizations_p = 0; | 8860 | if (w == XWINDOW (selected_window)) |
| 8904 | w->current_matrix->buffer = b; | 8861 | w->last_point = make_number (BUF_PT (b)); |
| 8905 | w->current_matrix->begv = BUF_BEGV (b); | 8862 | else |
| 8906 | w->current_matrix->zv = BUF_ZV (b); | 8863 | w->last_point = make_number (XMARKER (w->pointm)->charpos); |
| 8907 | w->last_cursor = w->cursor; | ||
| 8908 | w->last_cursor_off_p = w->cursor_off_p; | ||
| 8909 | if (w == XWINDOW (selected_window)) | ||
| 8910 | w->last_point = make_number (BUF_PT (b)); | ||
| 8911 | else | ||
| 8912 | w->last_point = make_number (XMARKER (w->pointm)->charpos); | ||
| 8913 | } | ||
| 8914 | } | 8864 | } |
| 8865 | } | ||
| 8915 | 8866 | ||
| 8867 | if (accurate_p) | ||
| 8868 | { | ||
| 8916 | w->window_end_valid = w->buffer; | 8869 | w->window_end_valid = w->buffer; |
| 8917 | w->update_mode_line = Qnil; | 8870 | w->update_mode_line = Qnil; |
| 8871 | } | ||
| 8872 | } | ||
| 8873 | |||
| 8874 | |||
| 8875 | /* Mark the display of windows in the window tree rooted at WINDOW as | ||
| 8876 | accurate or inaccurate. If ACCURATE_P is non-zero mark display of | ||
| 8877 | windows as accurate. If ACCURATE_P is zero, arrange for windows to | ||
| 8878 | be redisplayed the next time redisplay_internal is called. */ | ||
| 8879 | |||
| 8880 | void | ||
| 8881 | mark_window_display_accurate (window, accurate_p) | ||
| 8882 | Lisp_Object window; | ||
| 8883 | int accurate_p; | ||
| 8884 | { | ||
| 8885 | struct window *w; | ||
| 8886 | |||
| 8887 | for (; !NILP (window); window = w->next) | ||
| 8888 | { | ||
| 8889 | w = XWINDOW (window); | ||
| 8890 | mark_window_display_accurate_1 (w, accurate_p); | ||
| 8918 | 8891 | ||
| 8919 | if (!NILP (w->vchild)) | 8892 | if (!NILP (w->vchild)) |
| 8920 | mark_window_display_accurate (w->vchild, accurate_p); | 8893 | mark_window_display_accurate (w->vchild, accurate_p); |