diff options
| author | Eli Zaretskii | 2010-03-28 11:18:10 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-03-28 11:18:10 -0400 |
| commit | c0546589ab9573047bb0d6cb82e27fe29221b71a (patch) | |
| tree | cb3ca8a0384a635a036bbf5ec577907a7ad1d660 /src | |
| parent | e7dbdb6dfc3ffdc25f8d32a43683500f596d9784 (diff) | |
| download | emacs-c0546589ab9573047bb0d6cb82e27fe29221b71a.tar.gz emacs-c0546589ab9573047bb0d6cb82e27fe29221b71a.zip | |
Fix glyph_row reversed_p flag in empty lines between paragraphs.
bidi.c (bidi_get_next_char_visually): Improve commentary.
dispextern.h (PRODUCE_GLYPHS): Set the reversed_p flag in the
iterator's glyph_row here.
xdisp.c (handle_invisible_prop, set_iterator_to_next)
(next_element_from_buffer): Don't set the reversed_p flag in the
iterator's glyph_row here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 11 | ||||
| -rw-r--r-- | src/bidi.c | 6 | ||||
| -rw-r--r-- | src/dispextern.h | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 36 |
4 files changed, 23 insertions, 37 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 9e0236fcefb..d27f747466b 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2010-03-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * bidi.c (bidi_get_next_char_visually): Improve commentary. | ||
| 4 | |||
| 5 | * dispextern.h (PRODUCE_GLYPHS): Set the reversed_p flag in the | ||
| 6 | iterator's glyph_row here. | ||
| 7 | |||
| 8 | * xdisp.c (handle_invisible_prop, set_iterator_to_next) | ||
| 9 | (next_element_from_buffer): Don't set the reversed_p flag in the | ||
| 10 | iterator's glyph_row here. | ||
| 11 | |||
| 1 | 2010-03-20 Eli Zaretskii <eliz@gnu.org> | 12 | 2010-03-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 13 | ||
| 3 | * xdisp.c (set_cursor_from_row): Don't miss a candidate row whose | 14 | * xdisp.c (set_cursor_from_row): Don't miss a candidate row whose |
diff --git a/src/bidi.c b/src/bidi.c index 5c0169071ff..8089bf811a6 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -1901,7 +1901,7 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it) | |||
| 1901 | 1901 | ||
| 1902 | /* Reordering of resolved levels (clause L2) is implemented by | 1902 | /* Reordering of resolved levels (clause L2) is implemented by |
| 1903 | jumping to the other edge of the level and flipping direction of | 1903 | jumping to the other edge of the level and flipping direction of |
| 1904 | scanning the buffer whenever we find a level change. */ | 1904 | scanning the text whenever we find a level change. */ |
| 1905 | if (new_level != old_level) | 1905 | if (new_level != old_level) |
| 1906 | { | 1906 | { |
| 1907 | int ascending = new_level > old_level; | 1907 | int ascending = new_level > old_level; |
| @@ -1959,7 +1959,9 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it) | |||
| 1959 | paragraph direction, if needed. We do this at the newline before | 1959 | paragraph direction, if needed. We do this at the newline before |
| 1960 | the paragraph separator, because the next character might not be | 1960 | the paragraph separator, because the next character might not be |
| 1961 | the first character of the next paragraph, due to the bidi | 1961 | the first character of the next paragraph, due to the bidi |
| 1962 | reordering. */ | 1962 | reordering, whereas we _must_ know the paragraph base direction |
| 1963 | _before_ we process the paragraph's text, since the base | ||
| 1964 | direction affects the reordering. */ | ||
| 1963 | if (bidi_it->scan_dir == 1 | 1965 | if (bidi_it->scan_dir == 1 |
| 1964 | && bidi_it->orig_type == NEUTRAL_B | 1966 | && bidi_it->orig_type == NEUTRAL_B |
| 1965 | && bidi_it->bytepos < ZV_BYTE) | 1967 | && bidi_it->bytepos < ZV_BYTE) |
diff --git a/src/dispextern.h b/src/dispextern.h index 03b35df397c..5083199c529 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2399,6 +2399,13 @@ struct it | |||
| 2399 | #define PRODUCE_GLYPHS(IT) \ | 2399 | #define PRODUCE_GLYPHS(IT) \ |
| 2400 | do { \ | 2400 | do { \ |
| 2401 | extern int inhibit_free_realized_faces; \ | 2401 | extern int inhibit_free_realized_faces; \ |
| 2402 | if ((IT)->glyph_row != NULL && (IT)->bidi_p) \ | ||
| 2403 | { \ | ||
| 2404 | if ((IT)->bidi_it.paragraph_dir == R2L) \ | ||
| 2405 | (IT)->glyph_row->reversed_p = 1; \ | ||
| 2406 | else \ | ||
| 2407 | (IT)->glyph_row->reversed_p = 0; \ | ||
| 2408 | } \ | ||
| 2402 | if (FRAME_RIF ((IT)->f) != NULL) \ | 2409 | if (FRAME_RIF ((IT)->f) != NULL) \ |
| 2403 | FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \ | 2410 | FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \ |
| 2404 | else \ | 2411 | else \ |
diff --git a/src/xdisp.c b/src/xdisp.c index f2e06c0a2e7..867018180aa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3869,15 +3869,6 @@ handle_invisible_prop (it) | |||
| 3869 | skip any text at the beginning, which resets the | 3869 | skip any text at the beginning, which resets the |
| 3870 | FIRST_ELT flag. */ | 3870 | FIRST_ELT flag. */ |
| 3871 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | 3871 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); |
| 3872 | /* If the paragraph base direction is R2L, its | ||
| 3873 | glyphs should be reversed. */ | ||
| 3874 | if (it->glyph_row) | ||
| 3875 | { | ||
| 3876 | if (it->bidi_it.paragraph_dir == R2L) | ||
| 3877 | it->glyph_row->reversed_p = 1; | ||
| 3878 | else | ||
| 3879 | it->glyph_row->reversed_p = 0; | ||
| 3880 | } | ||
| 3881 | } | 3872 | } |
| 3882 | do | 3873 | do |
| 3883 | { | 3874 | { |
| @@ -6235,16 +6226,7 @@ set_iterator_to_next (it, reseat_p) | |||
| 6235 | /* If this is a new paragraph, determine its base | 6226 | /* If this is a new paragraph, determine its base |
| 6236 | direction (a.k.a. its base embedding level). */ | 6227 | direction (a.k.a. its base embedding level). */ |
| 6237 | if (it->bidi_it.new_paragraph) | 6228 | if (it->bidi_it.new_paragraph) |
| 6238 | { | 6229 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); |
| 6239 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | ||
| 6240 | if (it->glyph_row) | ||
| 6241 | { | ||
| 6242 | if (it->bidi_it.paragraph_dir == R2L) | ||
| 6243 | it->glyph_row->reversed_p = 1; | ||
| 6244 | else | ||
| 6245 | it->glyph_row->reversed_p = 0; | ||
| 6246 | } | ||
| 6247 | } | ||
| 6248 | bidi_get_next_char_visually (&it->bidi_it); | 6230 | bidi_get_next_char_visually (&it->bidi_it); |
| 6249 | IT_BYTEPOS (*it) = it->bidi_it.bytepos; | 6231 | IT_BYTEPOS (*it) = it->bidi_it.bytepos; |
| 6250 | IT_CHARPOS (*it) = it->bidi_it.charpos; | 6232 | IT_CHARPOS (*it) = it->bidi_it.charpos; |
| @@ -6705,15 +6687,6 @@ next_element_from_buffer (it) | |||
| 6705 | || FETCH_CHAR (it->bidi_it.bytepos) == '\n') | 6687 | || FETCH_CHAR (it->bidi_it.bytepos) == '\n') |
| 6706 | { | 6688 | { |
| 6707 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | 6689 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); |
| 6708 | /* If the paragraph base direction is R2L, its glyphs should | ||
| 6709 | be reversed. */ | ||
| 6710 | if (it->glyph_row) | ||
| 6711 | { | ||
| 6712 | if (it->bidi_it.paragraph_dir == R2L) | ||
| 6713 | it->glyph_row->reversed_p = 1; | ||
| 6714 | else | ||
| 6715 | it->glyph_row->reversed_p = 0; | ||
| 6716 | } | ||
| 6717 | bidi_get_next_char_visually (&it->bidi_it); | 6690 | bidi_get_next_char_visually (&it->bidi_it); |
| 6718 | } | 6691 | } |
| 6719 | else | 6692 | else |
| @@ -6728,13 +6701,6 @@ next_element_from_buffer (it) | |||
| 6728 | it->bidi_it.charpos = IT_CHARPOS (*it); | 6701 | it->bidi_it.charpos = IT_CHARPOS (*it); |
| 6729 | it->bidi_it.bytepos = IT_BYTEPOS (*it); | 6702 | it->bidi_it.bytepos = IT_BYTEPOS (*it); |
| 6730 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); | 6703 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); |
| 6731 | if (it->glyph_row) | ||
| 6732 | { | ||
| 6733 | if (it->bidi_it.paragraph_dir == R2L) | ||
| 6734 | it->glyph_row->reversed_p = 1; | ||
| 6735 | else | ||
| 6736 | it->glyph_row->reversed_p = 0; | ||
| 6737 | } | ||
| 6738 | do | 6704 | do |
| 6739 | { | 6705 | { |
| 6740 | /* Now return to buffer position where we were asked to | 6706 | /* Now return to buffer position where we were asked to |