Mercurial > emacs
comparison src/fringe.c @ 90224:2d92f5c9d6ae
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-78
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 514-518)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 104-105)
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 26 Aug 2005 09:51:52 +0000 |
parents | f9a65d7ebd29 67861e2e09d6 |
children | 7beb78bc1f8e |
comparison
equal
deleted
inserted
replaced
90223:edf295560b5a | 90224:2d92f5c9d6ae |
---|---|
1 /* Fringe handling (split from xdisp.c). | 1 /* Fringe handling (split from xdisp.c). |
2 Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03,04 | 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, |
3 Free Software Foundation, Inc. | 3 1998, 1999, 2000, 2000, 2001, 2002, 2003, 2004, |
4 2005 Free Software Foundation, Inc. | |
4 | 5 |
5 This file is part of GNU Emacs. | 6 This file is part of GNU Emacs. |
6 | 7 |
7 GNU Emacs is free software; you can redistribute it and/or modify | 8 GNU Emacs is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
774 return updated; | 775 return updated; |
775 } | 776 } |
776 | 777 |
777 | 778 |
778 /* Recalculate the bitmaps to show in the fringes of window W. | 779 /* Recalculate the bitmaps to show in the fringes of window W. |
779 If FORCE_P is 0, only mark rows with modified bitmaps for update in | 780 Only mark rows with modified bitmaps for update in redraw_fringe_bitmaps_p. |
780 redraw_fringe_bitmaps_p; else mark all rows for update. */ | 781 |
782 If KEEP_CURRENT_P is 0, update current_matrix too. */ | |
781 | 783 |
782 int | 784 int |
783 update_window_fringes (w, force_p) | 785 update_window_fringes (w, keep_current_p) |
784 struct window *w; | 786 struct window *w; |
785 int force_p; | 787 int keep_current_p; |
786 { | 788 { |
787 struct glyph_row *row, *cur = 0; | 789 struct glyph_row *row, *cur = 0; |
788 int yb = window_text_bottom_y (w); | 790 int yb = window_text_bottom_y (w); |
789 int rn, nrows = w->current_matrix->nrows; | 791 int rn, nrows = w->current_matrix->nrows; |
790 int y; | 792 int y; |
846 | 848 |
847 if (!row->mode_line_p) | 849 if (!row->mode_line_p) |
848 { | 850 { |
849 if (!done_top) | 851 if (!done_top) |
850 { | 852 { |
851 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) | 853 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) |
854 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) | |
852 row->indicate_bob_p = !NILP (boundary_top); | 855 row->indicate_bob_p = !NILP (boundary_top); |
853 else | 856 else |
854 row->indicate_top_line_p = !NILP (arrow_top); | 857 row->indicate_top_line_p = !NILP (arrow_top); |
855 done_top = 1; | 858 done_top = 1; |
856 } | 859 } |
857 | 860 |
858 if (!done_bot) | 861 if (!done_bot) |
859 { | 862 { |
860 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) | 863 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) |
864 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) | |
861 row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; | 865 row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; |
862 else if (y + row->height >= yb) | 866 else if (y + row->height >= yb) |
863 row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; | 867 row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; |
864 } | 868 } |
865 } | 869 } |
940 else if (row->indicate_empty_line_p && EQ (empty_pos, Qright)) | 944 else if (row->indicate_empty_line_p && EQ (empty_pos, Qright)) |
941 right = ZV_LINE_BITMAP; | 945 right = ZV_LINE_BITMAP; |
942 else | 946 else |
943 right = NO_FRINGE_BITMAP; | 947 right = NO_FRINGE_BITMAP; |
944 | 948 |
945 if (force_p | 949 if (row->y != cur->y |
946 || row->y != cur->y | |
947 || row->visible_height != cur->visible_height | 950 || row->visible_height != cur->visible_height |
948 || row->ends_at_zv_p != cur->ends_at_zv_p | 951 || row->ends_at_zv_p != cur->ends_at_zv_p |
949 || left != cur->left_fringe_bitmap | 952 || left != cur->left_fringe_bitmap |
950 || right != cur->right_fringe_bitmap | 953 || right != cur->right_fringe_bitmap |
951 || left_face_id != cur->left_fringe_face_id | 954 || left_face_id != cur->left_fringe_face_id |
952 || right_face_id != cur->right_fringe_face_id | 955 || right_face_id != cur->right_fringe_face_id |
953 || cur->redraw_fringe_bitmaps_p) | 956 || cur->redraw_fringe_bitmaps_p) |
954 { | 957 { |
955 redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1; | 958 redraw_p = row->redraw_fringe_bitmaps_p = 1; |
956 cur->left_fringe_bitmap = left; | 959 if (!keep_current_p) |
957 cur->right_fringe_bitmap = right; | 960 { |
958 cur->left_fringe_face_id = left_face_id; | 961 cur->redraw_fringe_bitmaps_p = 1; |
959 cur->right_fringe_face_id = right_face_id; | 962 cur->left_fringe_bitmap = left; |
963 cur->right_fringe_bitmap = right; | |
964 cur->left_fringe_face_id = left_face_id; | |
965 cur->right_fringe_face_id = right_face_id; | |
966 } | |
960 } | 967 } |
961 | 968 |
962 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap) | 969 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap) |
963 { | 970 { |
964 redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1; | 971 redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1; |
972 | 979 |
973 if (rn > 0 && row->redraw_fringe_bitmaps_p) | 980 if (rn > 0 && row->redraw_fringe_bitmaps_p) |
974 row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; | 981 row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; |
975 } | 982 } |
976 | 983 |
977 return redraw_p; | 984 return redraw_p && !keep_current_p; |
978 } | 985 } |
979 | 986 |
980 | 987 |
981 /* Compute actual fringe widths for frame F. | 988 /* Compute actual fringe widths for frame F. |
982 | 989 |