diff options
| author | Eli Zaretskii | 2010-01-01 06:45:36 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 06:45:36 -0500 |
| commit | 29e3d8d1cb8920b16e70b2a19ddd8e597969b10b (patch) | |
| tree | 0da2bf98d8d51b10ffee7deaaab39c2e2cd33e48 /src | |
| parent | 5e65aec01a9bc5a147e492f11dd0115c98bedef4 (diff) | |
| download | emacs-29e3d8d1cb8920b16e70b2a19ddd8e597969b10b.tar.gz emacs-29e3d8d1cb8920b16e70b2a19ddd8e597969b10b.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 14 | ||||
| -rw-r--r-- | src/bidi.c | 2 | ||||
| -rw-r--r-- | src/dispextern.h | 24 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
4 files changed, 41 insertions, 11 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 9824981c086..d4146e4c2e6 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2009-10-24 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix off-by-one error when | ||
| 4 | skipping over non-character glyphs at end of a reversed row. | ||
| 5 | |||
| 6 | * dispextern.h (struct glyph): The `resolved_level' member needs | ||
| 7 | only 5 bits, not 6. The `bidi_type' member needs only 3 bits. | ||
| 8 | (bidi_type_t): Rearrange so that types that can appear in the | ||
| 9 | resolved type are at the beginning and have values less than 8. | ||
| 10 | |||
| 11 | 2009-10-23 Eli Zaretskii <eliz@gnu.org> | ||
| 12 | |||
| 13 | * bidi.c: Include setjmp.h. | ||
| 14 | |||
| 1 | 2009-10-17 Eli Zaretskii <eliz@gnu.org> | 15 | 2009-10-17 Eli Zaretskii <eliz@gnu.org> |
| 2 | 16 | ||
| 3 | * dispextern.h (struct glyph): New members resolved_level and | 17 | * dispextern.h (struct glyph): New members resolved_level and |
diff --git a/src/bidi.c b/src/bidi.c index 3a2d45cdb4d..4b239caa6f8 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -55,6 +55,8 @@ Boston, MA 02110-1301, USA. */ | |||
| 55 | #include <string.h> | 55 | #include <string.h> |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | #include <setjmp.h> | ||
| 59 | |||
| 58 | #include "lisp.h" | 60 | #include "lisp.h" |
| 59 | #include "buffer.h" | 61 | #include "buffer.h" |
| 60 | #include "character.h" | 62 | #include "character.h" |
diff --git a/src/dispextern.h b/src/dispextern.h index 5f18b7f3a4a..19e3f13fd87 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -371,11 +371,14 @@ struct glyph | |||
| 371 | unsigned avoid_cursor_p : 1; | 371 | unsigned avoid_cursor_p : 1; |
| 372 | 372 | ||
| 373 | /* Resolved bidirection level of the characters [0..63]. */ | 373 | /* Resolved bidirection level of the characters [0..63]. */ |
| 374 | unsigned resolved_level : 6; | 374 | unsigned resolved_level : 5; |
| 375 | 375 | ||
| 376 | /* Resolved bidirectional type of this character, see enum | 376 | /* Resolved bidirectional type of this character, see enum |
| 377 | bidi_type_t below. */ | 377 | bidi_type_t below. Note that according to UAX#9, only some |
| 378 | unsigned bidi_type : 5; | 378 | values (STRONG_L, STRONG_R, WEAK_AN, WEAK_EN, WEAK_BN, and |
| 379 | NEUTRAL_B) can appear in the resolved type, so we only reserve | ||
| 380 | space for those that can. */ | ||
| 381 | unsigned bidi_type : 3; | ||
| 379 | 382 | ||
| 380 | #define FACE_ID_BITS 20 | 383 | #define FACE_ID_BITS 20 |
| 381 | 384 | ||
| @@ -1726,25 +1729,28 @@ extern int face_change_count; | |||
| 1726 | /* For BIDI */ | 1729 | /* For BIDI */ |
| 1727 | #define BIDI_MAXLEVEL 64 | 1730 | #define BIDI_MAXLEVEL 64 |
| 1728 | 1731 | ||
| 1729 | /* Data type for describing the bidirectional character types. */ | 1732 | /* Data type for describing the bidirectional character types. The |
| 1733 | first 7 must be at the beginning, because they are the only values | ||
| 1734 | valid in the `bidi_type' member of `struct glyph'; we only reserve | ||
| 1735 | 3 bits for it, so we cannot use there values larger than 7. */ | ||
| 1730 | typedef enum { | 1736 | typedef enum { |
| 1731 | UNKNOWN_BT, | 1737 | UNKNOWN_BT = 0, |
| 1732 | STRONG_L, /* strong left-to-right */ | 1738 | STRONG_L, /* strong left-to-right */ |
| 1733 | STRONG_R, /* strong right-to-left */ | 1739 | STRONG_R, /* strong right-to-left */ |
| 1740 | WEAK_EN, /* european number */ | ||
| 1741 | WEAK_AN, /* arabic number */ | ||
| 1742 | WEAK_BN, /* boundary neutral */ | ||
| 1743 | NEUTRAL_B, /* paragraph separator */ | ||
| 1734 | STRONG_AL, /* arabic right-to-left letter */ | 1744 | STRONG_AL, /* arabic right-to-left letter */ |
| 1735 | LRE, /* left-to-right embedding */ | 1745 | LRE, /* left-to-right embedding */ |
| 1736 | LRO, /* left-to-right override */ | 1746 | LRO, /* left-to-right override */ |
| 1737 | RLE, /* right-to-left embedding */ | 1747 | RLE, /* right-to-left embedding */ |
| 1738 | RLO, /* right-to-left override */ | 1748 | RLO, /* right-to-left override */ |
| 1739 | PDF, /* pop directional format */ | 1749 | PDF, /* pop directional format */ |
| 1740 | WEAK_EN, /* european number */ | ||
| 1741 | WEAK_ES, /* european number separator */ | 1750 | WEAK_ES, /* european number separator */ |
| 1742 | WEAK_ET, /* european number terminator */ | 1751 | WEAK_ET, /* european number terminator */ |
| 1743 | WEAK_AN, /* arabic number */ | ||
| 1744 | WEAK_CS, /* common separator */ | 1752 | WEAK_CS, /* common separator */ |
| 1745 | WEAK_NSM, /* non-spacing mark */ | 1753 | WEAK_NSM, /* non-spacing mark */ |
| 1746 | WEAK_BN, /* boundary neutral */ | ||
| 1747 | NEUTRAL_B, /* paragraph separator */ | ||
| 1748 | NEUTRAL_S, /* segment separator */ | 1754 | NEUTRAL_S, /* segment separator */ |
| 1749 | NEUTRAL_WS, /* whitespace */ | 1755 | NEUTRAL_WS, /* whitespace */ |
| 1750 | NEUTRAL_ON /* other neutrals */ | 1756 | NEUTRAL_ON /* other neutrals */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 90f16b938c0..b44ce759870 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12520,8 +12520,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 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; |
| @@ -20926,6 +20926,8 @@ append_glyph (it) | |||
| 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]; |
| @@ -20983,6 +20985,8 @@ append_composite_glyph (it) | |||
| 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]; |
| @@ -21162,6 +21166,8 @@ produce_image_glyph (it) | |||
| 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]; |
| @@ -21213,6 +21219,8 @@ append_stretch_glyph (it, object, width, height, ascent) | |||
| 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]; |