diff options
| author | Eli Zaretskii | 2010-04-23 21:10:31 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-23 21:10:31 +0300 |
| commit | b893a1502db32da5d0d0e26a90b5d26d2ee4ee04 (patch) | |
| tree | 7375146735e09b75c37c269a76258881316de5b2 | |
| parent | 8785b8887a35e22970b65409de0738302b91c982 (diff) | |
| download | emacs-b893a1502db32da5d0d0e26a90b5d26d2ee4ee04.tar.gz emacs-b893a1502db32da5d0d0e26a90b5d26d2ee4ee04.zip | |
Fix display of composed characters from L2R scripts in bidi buffers.
xdisp.c (set_iterator_to_next, next_element_from_composition): After
advancing IT past the composition, resync the bidi iterator with
IT's position. (Bug#5977)
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 25f5a2af42a..f5f6e8c4421 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * xdisp.c (pop_it): When the stack is popped after displaying | 3 | * xdisp.c (pop_it): When the stack is popped after displaying |
| 4 | from a string, bidi-iterate to exit from the text portion covered | 4 | from a string, bidi-iterate to exit from the text portion covered |
| 5 | by the `display' property or overlay. (Bug#5988, bug#5920) | 5 | by the `display' property or overlay. (Bug#5988, bug#5920) |
| 6 | (set_iterator_to_next, next_element_from_composition): Fix display | ||
| 7 | of composed characters from L2R scripts in bidi buffers. | ||
| 8 | (Bug#5977) | ||
| 6 | 9 | ||
| 7 | 2010-04-23 Dan Nicolaescu <dann@ics.uci.edu> | 10 | 2010-04-23 Dan Nicolaescu <dann@ics.uci.edu> |
| 8 | 11 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index e68c4f6f292..753ea16db01 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5309,7 +5309,7 @@ pop_it (it) | |||
| 5309 | determine the paragraph base direction if the overlay we | 5309 | determine the paragraph base direction if the overlay we |
| 5310 | just processed is at the beginning of a new | 5310 | just processed is at the beginning of a new |
| 5311 | paragraph. */ | 5311 | paragraph. */ |
| 5312 | if (it->bidi_it.first_elt) | 5312 | if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) |
| 5313 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | 5313 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); |
| 5314 | /* prev_stop can be zero, so check against BEGV as well. */ | 5314 | /* prev_stop can be zero, so check against BEGV as well. */ |
| 5315 | while (it->bidi_it.charpos >= BEGV | 5315 | while (it->bidi_it.charpos >= BEGV |
| @@ -6274,6 +6274,15 @@ set_iterator_to_next (it, reseat_p) | |||
| 6274 | { | 6274 | { |
| 6275 | IT_CHARPOS (*it) += it->cmp_it.nchars; | 6275 | IT_CHARPOS (*it) += it->cmp_it.nchars; |
| 6276 | IT_BYTEPOS (*it) += it->cmp_it.nbytes; | 6276 | IT_BYTEPOS (*it) += it->cmp_it.nbytes; |
| 6277 | if (it->bidi_p) | ||
| 6278 | { | ||
| 6279 | if (it->bidi_it.new_paragraph) | ||
| 6280 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | ||
| 6281 | /* Resync the bidi iterator with IT's new position. | ||
| 6282 | FIXME: this doesn't support bidirectional text. */ | ||
| 6283 | while (it->bidi_it.charpos < IT_CHARPOS (*it)) | ||
| 6284 | bidi_get_next_char_visually (&it->bidi_it); | ||
| 6285 | } | ||
| 6277 | if (it->cmp_it.to < it->cmp_it.nglyphs) | 6286 | if (it->cmp_it.to < it->cmp_it.nglyphs) |
| 6278 | it->cmp_it.from = it->cmp_it.to; | 6287 | it->cmp_it.from = it->cmp_it.to; |
| 6279 | else | 6288 | else |
| @@ -6995,6 +7004,15 @@ next_element_from_composition (it) | |||
| 6995 | { | 7004 | { |
| 6996 | IT_CHARPOS (*it) += it->cmp_it.nchars; | 7005 | IT_CHARPOS (*it) += it->cmp_it.nchars; |
| 6997 | IT_BYTEPOS (*it) += it->cmp_it.nbytes; | 7006 | IT_BYTEPOS (*it) += it->cmp_it.nbytes; |
| 7007 | if (it->bidi_p) | ||
| 7008 | { | ||
| 7009 | if (it->bidi_it.new_paragraph) | ||
| 7010 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | ||
| 7011 | /* Resync the bidi iterator with IT's new position. | ||
| 7012 | FIXME: this doesn't support bidirectional text. */ | ||
| 7013 | while (it->bidi_it.charpos < IT_CHARPOS (*it)) | ||
| 7014 | bidi_get_next_char_visually (&it->bidi_it); | ||
| 7015 | } | ||
| 6998 | return 0; | 7016 | return 0; |
| 6999 | } | 7017 | } |
| 7000 | it->position = it->current.pos; | 7018 | it->position = it->current.pos; |