aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-05-24 20:45:04 -0700
committerGlenn Morris2011-05-24 20:45:04 -0700
commitb9345dfd4b5479ec624f1870723a8ea5c9c719e7 (patch)
treeffe98c92f47b03463683ce41a1046d7dda5b13ca
parente949074338d3f5ccc7475721c7421eef6aea68d4 (diff)
parente61124cd850ad6e0fc511dc995031db77b3535cd (diff)
downloademacs-b9345dfd4b5479ec624f1870723a8ea5c9c719e7.tar.gz
emacs-b9345dfd4b5479ec624f1870723a8ea5c9c719e7.zip
Merge from emacs-23; up to 2010-06-12T08:59:37Z!albinus@detlef.
-rw-r--r--src/ChangeLog22
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c13
-rw-r--r--src/fringe.c39
-rw-r--r--src/xdisp.c26
5 files changed, 77 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b3b561a9370..e98cb2848a9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
4
5 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
6 for fringe update if it has periodic bitmap.
7 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
8 and fringe_bitmap_periodic_p.
9
10 * fringe.c (get_fringe_bitmap_data): New function.
11 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13 row. Mark glyph row for fringe update if periodicity changed.
14
15 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16 for fringe update unless it has periodic bitmap.
17
182011-05-25 Kenichi Handa <handa@m17n.org>
19
20 * xdisp.c (get_next_display_element): Set correct it->face_id for
21 a static composition.
22
12011-05-24 Leo Liu <sdl.web@gmail.com> 232011-05-24 Leo Liu <sdl.web@gmail.com>
2 24
3 * deps.mk (fns.o): 25 * deps.mk (fns.o):
diff --git a/src/dispextern.h b/src/dispextern.h
index 77c45cf2fc6..5d8b4562499 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -845,6 +845,10 @@ struct glyph_row
845 /* Vertical offset of the right fringe bitmap. */ 845 /* Vertical offset of the right fringe bitmap. */
846 signed right_fringe_offset : FRINGE_HEIGHT_BITS; 846 signed right_fringe_offset : FRINGE_HEIGHT_BITS;
847 847
848 /* 1 means that at least one of the left and right fringe bitmaps is
849 periodic and thus depends on the y-position of the row. */
850 unsigned fringe_bitmap_periodic_p : 1;
851
848 /* 1 means that we must draw the bitmaps of this row. */ 852 /* 1 means that we must draw the bitmaps of this row. */
849 unsigned redraw_fringe_bitmaps_p : 1; 853 unsigned redraw_fringe_bitmaps_p : 1;
850 854
diff --git a/src/dispnew.c b/src/dispnew.c
index 41f486baf16..7ae6c61d0c7 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -861,6 +861,8 @@ shift_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int start, in
861 row->visible_height -= min_y - row->y; 861 row->visible_height -= min_y - row->y;
862 if (row->y + row->height > max_y) 862 if (row->y + row->height > max_y)
863 row->visible_height -= row->y + row->height - max_y; 863 row->visible_height -= row->y + row->height - max_y;
864 if (row->fringe_bitmap_periodic_p)
865 row->redraw_fringe_bitmaps_p = 1;
864 } 866 }
865} 867}
866 868
@@ -1339,8 +1341,11 @@ row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
1339 || a->cursor_in_fringe_p != b->cursor_in_fringe_p 1341 || a->cursor_in_fringe_p != b->cursor_in_fringe_p
1340 || a->left_fringe_bitmap != b->left_fringe_bitmap 1342 || a->left_fringe_bitmap != b->left_fringe_bitmap
1341 || a->left_fringe_face_id != b->left_fringe_face_id 1343 || a->left_fringe_face_id != b->left_fringe_face_id
1344 || a->left_fringe_offset != b->left_fringe_offset
1342 || a->right_fringe_bitmap != b->right_fringe_bitmap 1345 || a->right_fringe_bitmap != b->right_fringe_bitmap
1343 || a->right_fringe_face_id != b->right_fringe_face_id 1346 || a->right_fringe_face_id != b->right_fringe_face_id
1347 || a->right_fringe_offset != b->right_fringe_offset
1348 || a->fringe_bitmap_periodic_p != b->fringe_bitmap_periodic_p
1344 || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap 1349 || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap
1345 || a->exact_window_width_line_p != b->exact_window_width_line_p 1350 || a->exact_window_width_line_p != b->exact_window_width_line_p
1346 || a->overlapped_p != b->overlapped_p 1351 || a->overlapped_p != b->overlapped_p
@@ -4565,13 +4570,7 @@ scrolling_window (struct window *w, int header_line_p)
4565 to = MATRIX_ROW (current_matrix, r->desired_vpos + j); 4570 to = MATRIX_ROW (current_matrix, r->desired_vpos + j);
4566 from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); 4571 from = MATRIX_ROW (desired_matrix, r->desired_vpos + j);
4567 to_overlapped_p = to->overlapped_p; 4572 to_overlapped_p = to->overlapped_p;
4568 if (!from->mode_line_p && !w->pseudo_window_p 4573 from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p;
4569 && (to->left_fringe_bitmap != from->left_fringe_bitmap
4570 || to->right_fringe_bitmap != from->right_fringe_bitmap
4571 || to->left_fringe_face_id != from->left_fringe_face_id
4572 || to->right_fringe_face_id != from->right_fringe_face_id
4573 || to->overlay_arrow_bitmap != from->overlay_arrow_bitmap))
4574 from->redraw_fringe_bitmaps_p = 1;
4575 assign_row (to, from); 4574 assign_row (to, from);
4576 to->enabled_p = 1, from->enabled_p = 0; 4575 to->enabled_p = 1, from->enabled_p = 0;
4577 to->overlapped_p = to_overlapped_p; 4576 to->overlapped_p = to_overlapped_p;
diff --git a/src/fringe.c b/src/fringe.c
index f2d61225be7..75c65bbcd87 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -521,6 +521,20 @@ get_fringe_bitmap_name (int bn)
521 return num; 521 return num;
522} 522}
523 523
524/* Get fringe bitmap data for bitmap number BN. */
525
526static struct fringe_bitmap *
527get_fringe_bitmap_data (int bn)
528{
529 struct fringe_bitmap *fb;
530
531 fb = fringe_bitmaps[bn];
532 if (fb == NULL)
533 fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
534 ? bn : UNDEF_FRINGE_BITMAP];
535
536 return fb;
537}
524 538
525/* Draw the bitmap WHICH in one of the left or right fringes of 539/* Draw the bitmap WHICH in one of the left or right fringes of
526 window W. ROW is the glyph row for which to display the bitmap; it 540 window W. ROW is the glyph row for which to display the bitmap; it
@@ -568,10 +582,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
568 face_id = FRINGE_FACE_ID; 582 face_id = FRINGE_FACE_ID;
569 } 583 }
570 584
571 fb = fringe_bitmaps[which]; 585 fb = get_fringe_bitmap_data (which);
572 if (fb == NULL)
573 fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS
574 ? which : UNDEF_FRINGE_BITMAP];
575 586
576 period = fb->period; 587 period = fb->period;
577 588
@@ -1041,12 +1052,8 @@ update_window_fringes (struct window *w, int keep_current_p)
1041 1052
1042 if (bn != NO_FRINGE_BITMAP) 1053 if (bn != NO_FRINGE_BITMAP)
1043 { 1054 {
1044 struct fringe_bitmap *fb; 1055 struct fringe_bitmap *fb = get_fringe_bitmap_data (bn);
1045 1056
1046 fb = fringe_bitmaps[bn];
1047 if (fb == NULL)
1048 fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
1049 ? bn : UNDEF_FRINGE_BITMAP];
1050 if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) 1057 if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0)
1051 { 1058 {
1052 struct glyph_row *row1; 1059 struct glyph_row *row1;
@@ -1100,12 +1107,8 @@ update_window_fringes (struct window *w, int keep_current_p)
1100 1107
1101 if (bn != NO_FRINGE_BITMAP) 1108 if (bn != NO_FRINGE_BITMAP)
1102 { 1109 {
1103 struct fringe_bitmap *fb; 1110 struct fringe_bitmap *fb = get_fringe_bitmap_data (bn);
1104 1111
1105 fb = fringe_bitmaps[bn];
1106 if (fb == NULL)
1107 fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
1108 ? bn : UNDEF_FRINGE_BITMAP];
1109 if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) 1112 if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0)
1110 { 1113 {
1111 struct glyph_row *row1; 1114 struct glyph_row *row1;
@@ -1141,6 +1144,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1141 int left, right; 1144 int left, right;
1142 unsigned left_face_id, right_face_id; 1145 unsigned left_face_id, right_face_id;
1143 int left_offset, right_offset; 1146 int left_offset, right_offset;
1147 int periodic_p;
1144 1148
1145 row = w->desired_matrix->rows + rn; 1149 row = w->desired_matrix->rows + rn;
1146 cur = w->current_matrix->rows + rn; 1150 cur = w->current_matrix->rows + rn;
@@ -1149,6 +1153,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1149 1153
1150 left_face_id = right_face_id = DEFAULT_FACE_ID; 1154 left_face_id = right_face_id = DEFAULT_FACE_ID;
1151 left_offset = right_offset = 0; 1155 left_offset = right_offset = 0;
1156 periodic_p = 0;
1152 1157
1153 /* Decide which bitmap to draw in the left fringe. */ 1158 /* Decide which bitmap to draw in the left fringe. */
1154 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) 1159 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@@ -1240,6 +1245,9 @@ update_window_fringes (struct window *w, int keep_current_p)
1240 else 1245 else
1241 right = NO_FRINGE_BITMAP; 1246 right = NO_FRINGE_BITMAP;
1242 1247
1248 periodic_p = (get_fringe_bitmap_data (left)->period != 0
1249 || get_fringe_bitmap_data (right)->period != 0);
1250
1243 if (row->y != cur->y 1251 if (row->y != cur->y
1244 || row->visible_height != cur->visible_height 1252 || row->visible_height != cur->visible_height
1245 || row->ends_at_zv_p != cur->ends_at_zv_p 1253 || row->ends_at_zv_p != cur->ends_at_zv_p
@@ -1249,6 +1257,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1249 || right_face_id != cur->right_fringe_face_id 1257 || right_face_id != cur->right_fringe_face_id
1250 || left_offset != cur->left_fringe_offset 1258 || left_offset != cur->left_fringe_offset
1251 || right_offset != cur->right_fringe_offset 1259 || right_offset != cur->right_fringe_offset
1260 || periodic_p != cur->fringe_bitmap_periodic_p
1252 || cur->redraw_fringe_bitmaps_p) 1261 || cur->redraw_fringe_bitmaps_p)
1253 { 1262 {
1254 redraw_p = row->redraw_fringe_bitmaps_p = 1; 1263 redraw_p = row->redraw_fringe_bitmaps_p = 1;
@@ -1261,6 +1270,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1261 cur->right_fringe_face_id = right_face_id; 1270 cur->right_fringe_face_id = right_face_id;
1262 cur->left_fringe_offset = left_offset; 1271 cur->left_fringe_offset = left_offset;
1263 cur->right_fringe_offset = right_offset; 1272 cur->right_fringe_offset = right_offset;
1273 cur->fringe_bitmap_periodic_p = periodic_p;
1264 } 1274 }
1265 } 1275 }
1266 1276
@@ -1279,6 +1289,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1279 row->right_fringe_face_id = right_face_id; 1289 row->right_fringe_face_id = right_face_id;
1280 row->left_fringe_offset = left_offset; 1290 row->left_fringe_offset = left_offset;
1281 row->right_fringe_offset = right_offset; 1291 row->right_fringe_offset = right_offset;
1292 row->fringe_bitmap_periodic_p = periodic_p;
1282 } 1293 }
1283 1294
1284 return redraw_p && !keep_current_p; 1295 return redraw_p && !keep_current_p;
diff --git a/src/xdisp.c b/src/xdisp.c
index 66e51ac2c32..c1ed3d9cdae 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5890,11 +5890,23 @@ get_next_display_element (struct it *it)
5890 else 5890 else
5891 { 5891 {
5892 EMACS_INT pos = (it->s ? -1 5892 EMACS_INT pos = (it->s ? -1
5893 : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) 5893 : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
5894 : IT_CHARPOS (*it)); 5894 : IT_CHARPOS (*it));
5895 int c;
5895 5896
5896 it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos, 5897 if (it->what == IT_CHARACTER)
5897 it->string); 5898 c = it->char_to_display;
5899 else
5900 {
5901 struct composition *cmp = composition_table[it->cmp_it.id];
5902 int i;
5903
5904 c = ' ';
5905 for (i = 0; i < cmp->glyph_len; i++)
5906 if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t')
5907 break;
5908 }
5909 it->face_id = FACE_FOR_CHAR (it->f, face, c, pos, it->string);
5898 } 5910 }
5899 } 5911 }
5900 5912
@@ -14817,7 +14829,8 @@ try_window_reusing_current_matrix (struct window *w)
14817 row->visible_height -= min_y - row->y; 14829 row->visible_height -= min_y - row->y;
14818 if (row->y + row->height > max_y) 14830 if (row->y + row->height > max_y)
14819 row->visible_height -= row->y + row->height - max_y; 14831 row->visible_height -= row->y + row->height - max_y;
14820 row->redraw_fringe_bitmaps_p = 1; 14832 if (row->fringe_bitmap_periodic_p)
14833 row->redraw_fringe_bitmaps_p = 1;
14821 14834
14822 it.current_y += row->height; 14835 it.current_y += row->height;
14823 14836
@@ -14979,7 +14992,8 @@ try_window_reusing_current_matrix (struct window *w)
14979 row->visible_height -= min_y - row->y; 14992 row->visible_height -= min_y - row->y;
14980 if (row->y + row->height > max_y) 14993 if (row->y + row->height > max_y)
14981 row->visible_height -= row->y + row->height - max_y; 14994 row->visible_height -= row->y + row->height - max_y;
14982 row->redraw_fringe_bitmaps_p = 1; 14995 if (row->fringe_bitmap_periodic_p)
14996 row->redraw_fringe_bitmaps_p = 1;
14983 } 14997 }
14984 14998
14985 /* Scroll the current matrix. */ 14999 /* Scroll the current matrix. */