comparison src/xdisp.c @ 107599:23f8a579b56e

Retrospective commit from 2009-10-24. Continue working on set_cursor_from_row. Cleanup of resolved_level and bidi_type members of struct glyph. xdisp.c (set_cursor_from_row): Fix off-by-one error when skipping over non-character glyphs at end of a reversed row. dispextern.h (struct glyph): The `resolved_level' member needs only 5 bits, not 6. The `bidi_type' member needs only 3 bits. (bidi_type_t): Rearrange so that types that can appear in the resolved type are at the beginning and have values less than 8. bidi.c: Include setjmp.h.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 01 Jan 2010 06:45:36 -0500
parents 4bad2c6338cc
children e47593843838
comparison
equal deleted inserted replaced
107598:4bad2c6338cc 107599:23f8a579b56e
12518 /* By default, put the cursor on the rightmost glyph. */ 12518 /* By default, put the cursor on the rightmost glyph. */
12519 for (g = end + 1; g < glyph; g++) 12519 for (g = end + 1; g < glyph; g++)
12520 x += g->pixel_width; 12520 x += g->pixel_width;
12521 cursor_x = x; 12521 cursor_x = x;
12522 while (end < glyph 12522 while (end < glyph
12523 && INTEGERP (end->object) 12523 && INTEGERP ((end + 1)->object)
12524 && end->charpos <= 0) 12524 && (end + 1)->charpos <= 0)
12525 ++end; 12525 ++end;
12526 glyph_before = glyph + 1; 12526 glyph_before = glyph + 1;
12527 glyph_after = end; 12527 glyph_after = end;
12528 } 12528 }
12529 } 12529 }
20924 glyph->slice = null_glyph_slice; 20924 glyph->slice = null_glyph_slice;
20925 glyph->font_type = FONT_TYPE_UNKNOWN; 20925 glyph->font_type = FONT_TYPE_UNKNOWN;
20926 if (it->bidi_p) 20926 if (it->bidi_p)
20927 { 20927 {
20928 glyph->resolved_level = it->bidi_it.resolved_level; 20928 glyph->resolved_level = it->bidi_it.resolved_level;
20929 if ((it->bidi_it.type & 7) != it->bidi_it.type)
20930 abort ();
20929 glyph->bidi_type = it->bidi_it.type; 20931 glyph->bidi_type = it->bidi_it.type;
20930 } 20932 }
20931 ++it->glyph_row->used[area]; 20933 ++it->glyph_row->used[area];
20932 } 20934 }
20933 else 20935 else
20981 glyph->slice = null_glyph_slice; 20983 glyph->slice = null_glyph_slice;
20982 glyph->font_type = FONT_TYPE_UNKNOWN; 20984 glyph->font_type = FONT_TYPE_UNKNOWN;
20983 if (it->bidi_p) 20985 if (it->bidi_p)
20984 { 20986 {
20985 glyph->resolved_level = it->bidi_it.resolved_level; 20987 glyph->resolved_level = it->bidi_it.resolved_level;
20988 if ((it->bidi_it.type & 7) != it->bidi_it.type)
20989 abort ();
20986 glyph->bidi_type = it->bidi_it.type; 20990 glyph->bidi_type = it->bidi_it.type;
20987 } 20991 }
20988 ++it->glyph_row->used[area]; 20992 ++it->glyph_row->used[area];
20989 } 20993 }
20990 else 20994 else
21160 glyph->slice = slice; 21164 glyph->slice = slice;
21161 glyph->font_type = FONT_TYPE_UNKNOWN; 21165 glyph->font_type = FONT_TYPE_UNKNOWN;
21162 if (it->bidi_p) 21166 if (it->bidi_p)
21163 { 21167 {
21164 glyph->resolved_level = it->bidi_it.resolved_level; 21168 glyph->resolved_level = it->bidi_it.resolved_level;
21169 if ((it->bidi_it.type & 7) != it->bidi_it.type)
21170 abort ();
21165 glyph->bidi_type = it->bidi_it.type; 21171 glyph->bidi_type = it->bidi_it.type;
21166 } 21172 }
21167 ++it->glyph_row->used[area]; 21173 ++it->glyph_row->used[area];
21168 } 21174 }
21169 else 21175 else
21211 glyph->slice = null_glyph_slice; 21217 glyph->slice = null_glyph_slice;
21212 glyph->font_type = FONT_TYPE_UNKNOWN; 21218 glyph->font_type = FONT_TYPE_UNKNOWN;
21213 if (it->bidi_p) 21219 if (it->bidi_p)
21214 { 21220 {
21215 glyph->resolved_level = it->bidi_it.resolved_level; 21221 glyph->resolved_level = it->bidi_it.resolved_level;
21222 if ((it->bidi_it.type & 7) != it->bidi_it.type)
21223 abort ();
21216 glyph->bidi_type = it->bidi_it.type; 21224 glyph->bidi_type = it->bidi_it.type;
21217 } 21225 }
21218 ++it->glyph_row->used[area]; 21226 ++it->glyph_row->used[area];
21219 } 21227 }
21220 else 21228 else