+2009-10-24 Eli Zaretskii <eliz@gnu.org>
+
+ * 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.
+
+2009-10-23 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c: Include setjmp.h.
+
2009-10-17 Eli Zaretskii <eliz@gnu.org>
* dispextern.h (struct glyph): New members resolved_level and
unsigned avoid_cursor_p : 1;
/* Resolved bidirection level of the characters [0..63]. */
- unsigned resolved_level : 6;
+ unsigned resolved_level : 5;
/* Resolved bidirectional type of this character, see enum
- bidi_type_t below. */
- unsigned bidi_type : 5;
+ bidi_type_t below. Note that according to UAX#9, only some
+ values (STRONG_L, STRONG_R, WEAK_AN, WEAK_EN, WEAK_BN, and
+ NEUTRAL_B) can appear in the resolved type, so we only reserve
+ space for those that can. */
+ unsigned bidi_type : 3;
#define FACE_ID_BITS 20
/* For BIDI */
#define BIDI_MAXLEVEL 64
-/* Data type for describing the bidirectional character types. */
+/* Data type for describing the bidirectional character types. The
+ first 7 must be at the beginning, because they are the only values
+ valid in the `bidi_type' member of `struct glyph'; we only reserve
+ 3 bits for it, so we cannot use there values larger than 7. */
typedef enum {
- UNKNOWN_BT,
+ UNKNOWN_BT = 0,
STRONG_L, /* strong left-to-right */
STRONG_R, /* strong right-to-left */
+ WEAK_EN, /* european number */
+ WEAK_AN, /* arabic number */
+ WEAK_BN, /* boundary neutral */
+ NEUTRAL_B, /* paragraph separator */
STRONG_AL, /* arabic right-to-left letter */
LRE, /* left-to-right embedding */
LRO, /* left-to-right override */
RLE, /* right-to-left embedding */
RLO, /* right-to-left override */
PDF, /* pop directional format */
- WEAK_EN, /* european number */
WEAK_ES, /* european number separator */
WEAK_ET, /* european number terminator */
- WEAK_AN, /* arabic number */
WEAK_CS, /* common separator */
WEAK_NSM, /* non-spacing mark */
- WEAK_BN, /* boundary neutral */
- NEUTRAL_B, /* paragraph separator */
NEUTRAL_S, /* segment separator */
NEUTRAL_WS, /* whitespace */
NEUTRAL_ON /* other neutrals */
x += g->pixel_width;
cursor_x = x;
while (end < glyph
- && INTEGERP (end->object)
- && end->charpos <= 0)
+ && INTEGERP ((end + 1)->object)
+ && (end + 1)->charpos <= 0)
++end;
glyph_before = glyph + 1;
glyph_after = end;
if (it->bidi_p)
{
glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
glyph->bidi_type = it->bidi_it.type;
}
++it->glyph_row->used[area];
if (it->bidi_p)
{
glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
glyph->bidi_type = it->bidi_it.type;
}
++it->glyph_row->used[area];
if (it->bidi_p)
{
glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
glyph->bidi_type = it->bidi_it.type;
}
++it->glyph_row->used[area];
if (it->bidi_p)
{
glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
glyph->bidi_type = it->bidi_it.type;
}
++it->glyph_row->used[area];