diff options
| author | Gerd Moellmann | 2000-07-12 15:10:30 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-12 15:10:30 +0000 |
| commit | e876ff42b9051fbb82f2b7a7ebcf5afc95b46a13 (patch) | |
| tree | 77d25d563b3ad2b75165a72cb685bb1d0e17f146 /src | |
| parent | 71b8321ed935cf4574a29ff258a7bc56602488cf (diff) | |
| download | emacs-e876ff42b9051fbb82f2b7a7ebcf5afc95b46a13.tar.gz emacs-e876ff42b9051fbb82f2b7a7ebcf5afc95b46a13.zip | |
(make_current): Preserve the mouse_face_p flag of the
current glyph row.
(update_window_line): Add parameter MOUSE_FACE_OVERWRITTEN_P. Set
it when any row is written to that contains glyphs highlighted in
mouse-face.
(update_window): Call the window update end hook with new
parameter MOUSE_FACE_OVERWRITTEN_P.
(direct_output_for_insert): Give up if row contains mouse-face.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 430be4e96ce..28ba65458c8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -154,7 +154,7 @@ void scroll_glyph_matrix_range P_ ((struct glyph_matrix *, int, int, | |||
| 154 | static void clear_window_matrices P_ ((struct window *, int)); | 154 | static void clear_window_matrices P_ ((struct window *, int)); |
| 155 | static void fill_up_glyph_row_area_with_spaces P_ ((struct glyph_row *, int)); | 155 | static void fill_up_glyph_row_area_with_spaces P_ ((struct glyph_row *, int)); |
| 156 | static int scrolling_window P_ ((struct window *, int)); | 156 | static int scrolling_window P_ ((struct window *, int)); |
| 157 | static int update_window_line P_ ((struct window *, int)); | 157 | static int update_window_line P_ ((struct window *, int, int *)); |
| 158 | static void update_marginal_area P_ ((struct window *, int, int)); | 158 | static void update_marginal_area P_ ((struct window *, int, int)); |
| 159 | static int update_text_area P_ ((struct window *, int)); | 159 | static int update_text_area P_ ((struct window *, int)); |
| 160 | static void make_current P_ ((struct glyph_matrix *, struct glyph_matrix *, | 160 | static void make_current P_ ((struct glyph_matrix *, struct glyph_matrix *, |
| @@ -2625,6 +2625,7 @@ make_current (desired_matrix, current_matrix, row) | |||
| 2625 | { | 2625 | { |
| 2626 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); | 2626 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); |
| 2627 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); | 2627 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); |
| 2628 | int mouse_face_p = current_row->mouse_face_p; | ||
| 2628 | 2629 | ||
| 2629 | /* Do current_row = desired_row. This exchanges glyph pointers | 2630 | /* Do current_row = desired_row. This exchanges glyph pointers |
| 2630 | between both rows, and does a structure assignment otherwise. */ | 2631 | between both rows, and does a structure assignment otherwise. */ |
| @@ -2632,6 +2633,7 @@ make_current (desired_matrix, current_matrix, row) | |||
| 2632 | 2633 | ||
| 2633 | /* Enable current_row to mark it as valid. */ | 2634 | /* Enable current_row to mark it as valid. */ |
| 2634 | current_row->enabled_p = 1; | 2635 | current_row->enabled_p = 1; |
| 2636 | current_row->mouse_face_p = mouse_face_p; | ||
| 2635 | 2637 | ||
| 2636 | /* If we are called on frame matrices, perform analogous operations | 2638 | /* If we are called on frame matrices, perform analogous operations |
| 2637 | for window matrices. */ | 2639 | for window matrices. */ |
| @@ -3134,6 +3136,7 @@ direct_output_for_insert (g) | |||
| 3134 | int added_width; | 3136 | int added_width; |
| 3135 | struct text_pos pos; | 3137 | struct text_pos pos; |
| 3136 | int delta, delta_bytes; | 3138 | int delta, delta_bytes; |
| 3139 | int mouse_face_overwritten_p; | ||
| 3137 | 3140 | ||
| 3138 | /* Not done directly. */ | 3141 | /* Not done directly. */ |
| 3139 | redisplay_performed_directly_p = 0; | 3142 | redisplay_performed_directly_p = 0; |
| @@ -3187,6 +3190,8 @@ direct_output_for_insert (g) | |||
| 3187 | DEFAULT_FACE_ID); | 3190 | DEFAULT_FACE_ID); |
| 3188 | 3191 | ||
| 3189 | glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); | 3192 | glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); |
| 3193 | if (glyph_row->mouse_face_p) | ||
| 3194 | return 0; | ||
| 3190 | 3195 | ||
| 3191 | /* Give up if highlighting trailing whitespace and we have trailing | 3196 | /* Give up if highlighting trailing whitespace and we have trailing |
| 3192 | whitespace in glyph_row. We would have to remove the trailing | 3197 | whitespace in glyph_row. We would have to remove the trailing |
| @@ -3360,7 +3365,7 @@ direct_output_for_insert (g) | |||
| 3360 | } | 3365 | } |
| 3361 | 3366 | ||
| 3362 | if (rif) | 3367 | if (rif) |
| 3363 | rif->update_window_end_hook (w, 1); | 3368 | rif->update_window_end_hook (w, 1, 0); |
| 3364 | update_end (f); | 3369 | update_end (f); |
| 3365 | updated_row = NULL; | 3370 | updated_row = NULL; |
| 3366 | fflush (stdout); | 3371 | fflush (stdout); |
| @@ -3633,9 +3638,6 @@ redraw_overlapped_rows (w, yb) | |||
| 3633 | struct window *w; | 3638 | struct window *w; |
| 3634 | int yb; | 3639 | int yb; |
| 3635 | { | 3640 | { |
| 3636 | int i, bottom_y; | ||
| 3637 | struct glyph_row *row; | ||
| 3638 | |||
| 3639 | /* If rows overlapping others have been changed, the rows being | 3641 | /* If rows overlapping others have been changed, the rows being |
| 3640 | overlapped have to be redrawn. This won't draw lines that have | 3642 | overlapped have to be redrawn. This won't draw lines that have |
| 3641 | already been drawn in update_window_line because overlapped_p in | 3643 | already been drawn in update_window_line because overlapped_p in |
| @@ -3643,7 +3645,7 @@ redraw_overlapped_rows (w, yb) | |||
| 3643 | current rows is 0. */ | 3645 | current rows is 0. */ |
| 3644 | for (i = 0; i < w->current_matrix->nrows; ++i) | 3646 | for (i = 0; i < w->current_matrix->nrows; ++i) |
| 3645 | { | 3647 | { |
| 3646 | row = w->current_matrix->rows + i; | 3648 | struct glyph_row *row = w->current_matrix->rows + i; |
| 3647 | 3649 | ||
| 3648 | if (!row->enabled_p) | 3650 | if (!row->enabled_p) |
| 3649 | break; | 3651 | break; |
| @@ -3667,8 +3669,7 @@ redraw_overlapped_rows (w, yb) | |||
| 3667 | row->overlapped_p = 0; | 3669 | row->overlapped_p = 0; |
| 3668 | } | 3670 | } |
| 3669 | 3671 | ||
| 3670 | bottom_y = MATRIX_ROW_BOTTOM_Y (row); | 3672 | if (MATRIX_ROW_BOTTOM_Y (row) >= yb) |
| 3671 | if (bottom_y >= yb) | ||
| 3672 | break; | 3673 | break; |
| 3673 | } | 3674 | } |
| 3674 | } | 3675 | } |
| @@ -3757,7 +3758,7 @@ update_window (w, force_p) | |||
| 3757 | struct glyph_row *row, *end; | 3758 | struct glyph_row *row, *end; |
| 3758 | struct glyph_row *mode_line_row; | 3759 | struct glyph_row *mode_line_row; |
| 3759 | struct glyph_row *header_line_row = NULL; | 3760 | struct glyph_row *header_line_row = NULL; |
| 3760 | int yb, changed_p = 0; | 3761 | int yb, changed_p = 0, mouse_face_overwritten_p = 0; |
| 3761 | 3762 | ||
| 3762 | rif->update_window_begin_hook (w); | 3763 | rif->update_window_begin_hook (w); |
| 3763 | yb = window_text_bottom_y (w); | 3764 | yb = window_text_bottom_y (w); |
| @@ -3775,7 +3776,8 @@ update_window (w, force_p) | |||
| 3775 | { | 3776 | { |
| 3776 | mode_line_row->y = yb; | 3777 | mode_line_row->y = yb; |
| 3777 | update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, | 3778 | update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, |
| 3778 | desired_matrix)); | 3779 | desired_matrix), |
| 3780 | &mouse_face_overwritten_p); | ||
| 3779 | changed_p = 1; | 3781 | changed_p = 1; |
| 3780 | } | 3782 | } |
| 3781 | 3783 | ||
| @@ -3806,7 +3808,7 @@ update_window (w, force_p) | |||
| 3806 | if (header_line_row && header_line_row->enabled_p) | 3808 | if (header_line_row && header_line_row->enabled_p) |
| 3807 | { | 3809 | { |
| 3808 | header_line_row->y = 0; | 3810 | header_line_row->y = 0; |
| 3809 | update_window_line (w, 0); | 3811 | update_window_line (w, 0, &mouse_face_overwritten_p); |
| 3810 | changed_p = 1; | 3812 | changed_p = 1; |
| 3811 | } | 3813 | } |
| 3812 | 3814 | ||
| @@ -3828,7 +3830,8 @@ update_window (w, force_p) | |||
| 3828 | if (!force_p && vpos % preempt_count == 0) | 3830 | if (!force_p && vpos % preempt_count == 0) |
| 3829 | detect_input_pending (); | 3831 | detect_input_pending (); |
| 3830 | 3832 | ||
| 3831 | changed_p |= update_window_line (w, vpos); | 3833 | changed_p |= update_window_line (w, vpos, |
| 3834 | &mouse_face_overwritten_p); | ||
| 3832 | 3835 | ||
| 3833 | /* Mark all rows below the last visible one in the current | 3836 | /* Mark all rows below the last visible one in the current |
| 3834 | matrix as invalid. This is necessary because of | 3837 | matrix as invalid. This is necessary because of |
| @@ -3850,24 +3853,19 @@ update_window (w, force_p) | |||
| 3850 | set_cursor: | 3853 | set_cursor: |
| 3851 | 3854 | ||
| 3852 | /* Fix the appearance of overlapping(overlapped rows. */ | 3855 | /* Fix the appearance of overlapping(overlapped rows. */ |
| 3853 | if (rif->fix_overlapping_area | ||
| 3854 | && !w->pseudo_window_p | ||
| 3855 | && changed_p | ||
| 3856 | && !paused_p) | ||
| 3857 | { | ||
| 3858 | redraw_overlapped_rows (w, yb); | ||
| 3859 | redraw_overlapping_rows (w, yb); | ||
| 3860 | } | ||
| 3861 | |||
| 3862 | if (!paused_p && !w->pseudo_window_p) | 3856 | if (!paused_p && !w->pseudo_window_p) |
| 3863 | { | 3857 | { |
| 3858 | if (changed_p && rif->fix_overlapping_area) | ||
| 3859 | { | ||
| 3860 | redraw_overlapped_rows (w, yb); | ||
| 3861 | redraw_overlapping_rows (w, yb); | ||
| 3862 | } | ||
| 3863 | |||
| 3864 | /* Make cursor visible at cursor position of W. */ | 3864 | /* Make cursor visible at cursor position of W. */ |
| 3865 | set_window_cursor_after_update (w); | 3865 | set_window_cursor_after_update (w); |
| 3866 | 3866 | ||
| 3867 | #if 0 | 3867 | #if 0 /* Check that current matrix invariants are satisfied. This is |
| 3868 | /* Check that current matrix invariants are satisfied. This | 3868 | for debugging only. See the comment of check_matrix_invariants. */ |
| 3869 | is for debugging only. See the comment around | ||
| 3870 | check_matrix_invariants. */ | ||
| 3871 | IF_DEBUG (check_matrix_invariants (w)); | 3869 | IF_DEBUG (check_matrix_invariants (w)); |
| 3872 | #endif | 3870 | #endif |
| 3873 | } | 3871 | } |
| @@ -3878,8 +3876,7 @@ update_window (w, force_p) | |||
| 3878 | #endif | 3876 | #endif |
| 3879 | 3877 | ||
| 3880 | /* End of update of window W. */ | 3878 | /* End of update of window W. */ |
| 3881 | rif->update_window_end_hook (w, 1); | 3879 | rif->update_window_end_hook (w, 1, mouse_face_overwritten_p); |
| 3882 | |||
| 3883 | } | 3880 | } |
| 3884 | else | 3881 | else |
| 3885 | paused_p = 1; | 3882 | paused_p = 1; |
| @@ -4098,9 +4095,9 @@ update_text_area (w, vpos) | |||
| 4098 | changed. */ | 4095 | changed. */ |
| 4099 | 4096 | ||
| 4100 | static int | 4097 | static int |
| 4101 | update_window_line (w, vpos) | 4098 | update_window_line (w, vpos, mouse_face_overwritten_p) |
| 4102 | struct window *w; | 4099 | struct window *w; |
| 4103 | int vpos; | 4100 | int vpos, *mouse_face_overwritten_p; |
| 4104 | { | 4101 | { |
| 4105 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); | 4102 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); |
| 4106 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); | 4103 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); |
| @@ -4116,12 +4113,17 @@ update_window_line (w, vpos) | |||
| 4116 | if (!desired_row->full_width_p | 4113 | if (!desired_row->full_width_p |
| 4117 | && !NILP (w->left_margin_width)) | 4114 | && !NILP (w->left_margin_width)) |
| 4118 | { | 4115 | { |
| 4119 | update_marginal_area (w, LEFT_MARGIN_AREA, vpos); | ||
| 4120 | changed_p = 1; | 4116 | changed_p = 1; |
| 4117 | update_marginal_area (w, LEFT_MARGIN_AREA, vpos); | ||
| 4121 | } | 4118 | } |
| 4122 | 4119 | ||
| 4123 | /* Update the display of the text area. */ | 4120 | /* Update the display of the text area. */ |
| 4124 | changed_p |= update_text_area (w, vpos); | 4121 | if (update_text_area (w, vpos)) |
| 4122 | { | ||
| 4123 | changed_p = 1; | ||
| 4124 | if (current_row->mouse_face_p) | ||
| 4125 | *mouse_face_overwritten_p = 1; | ||
| 4126 | } | ||
| 4125 | 4127 | ||
| 4126 | /* Update display of the right margin area, if there is one. */ | 4128 | /* Update display of the right margin area, if there is one. */ |
| 4127 | if (!desired_row->full_width_p | 4129 | if (!desired_row->full_width_p |
| @@ -4632,10 +4634,11 @@ scrolling_window (w, header_line_p) | |||
| 4632 | { | 4634 | { |
| 4633 | struct glyph_row *from, *to; | 4635 | struct glyph_row *from, *to; |
| 4634 | int to_overlapped_p; | 4636 | int to_overlapped_p; |
| 4635 | 4637 | ||
| 4636 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); | 4638 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); |
| 4637 | to_overlapped_p = to->overlapped_p; | ||
| 4638 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); | 4639 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); |
| 4640 | to_overlapped_p = to->overlapped_p; | ||
| 4641 | xassert (!to->mouse_face_p); | ||
| 4639 | assign_row (to, from); | 4642 | assign_row (to, from); |
| 4640 | to->enabled_p = 1, from->enabled_p = 0; | 4643 | to->enabled_p = 1, from->enabled_p = 0; |
| 4641 | to->overlapped_p = to_overlapped_p; | 4644 | to->overlapped_p = to_overlapped_p; |