diff src/dispextern.h @ 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 9e8415b885ee
line wrap: on
line diff
--- a/src/dispextern.h	Fri Jan 01 06:39:56 2010 -0500
+++ b/src/dispextern.h	Fri Jan 01 06:45:36 2010 -0500
@@ -371,11 +371,14 @@
   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
 
@@ -1726,25 +1729,28 @@
 /* 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 */