Mercurial > emacs
comparison src/xdisp.c @ 110647:c294bdb9cef3
Fix bug #7128.
xdisp.c (reseat_1): Initialize bidi_it.paragraph_dir to NEUTRAL_DIR.
(handle_invisible_prop, iterate_out_of_display_property)
(next_element_from_buffer): If bidi_it.first_elt is set, call
bidi_paragraph_init with NO_DEFAULT_P argument non-zero.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Wed, 29 Sep 2010 11:52:43 +0200 |
parents | 167af2298656 |
children | 624c74ddf6bf |
comparison
equal
deleted
inserted
replaced
110646:167af2298656 | 110647:c294bdb9cef3 |
---|---|
3829 to do it now because next_element_from_buffer may | 3829 to do it now because next_element_from_buffer may |
3830 not have a chance to do it, if we are going to | 3830 not have a chance to do it, if we are going to |
3831 skip any text at the beginning, which resets the | 3831 skip any text at the beginning, which resets the |
3832 FIRST_ELT flag. */ | 3832 FIRST_ELT flag. */ |
3833 bidi_paragraph_init (it->paragraph_embedding, | 3833 bidi_paragraph_init (it->paragraph_embedding, |
3834 &it->bidi_it, 0); | 3834 &it->bidi_it, 1); |
3835 } | 3835 } |
3836 do | 3836 do |
3837 { | 3837 { |
3838 bidi_move_to_visually_next (&it->bidi_it); | 3838 bidi_move_to_visually_next (&it->bidi_it); |
3839 } | 3839 } |
5150 { | 5150 { |
5151 /* Maybe initialize paragraph direction. If we are at the beginning | 5151 /* Maybe initialize paragraph direction. If we are at the beginning |
5152 of a new paragraph, next_element_from_buffer may not have a | 5152 of a new paragraph, next_element_from_buffer may not have a |
5153 chance to do that. */ | 5153 chance to do that. */ |
5154 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) | 5154 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) |
5155 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); | 5155 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); |
5156 /* prev_stop can be zero, so check against BEGV as well. */ | 5156 /* prev_stop can be zero, so check against BEGV as well. */ |
5157 while (it->bidi_it.charpos >= BEGV | 5157 while (it->bidi_it.charpos >= BEGV |
5158 && it->prev_stop <= it->bidi_it.charpos | 5158 && it->prev_stop <= it->bidi_it.charpos |
5159 && it->bidi_it.charpos < CHARPOS (it->position)) | 5159 && it->bidi_it.charpos < CHARPOS (it->position)) |
5160 bidi_move_to_visually_next (&it->bidi_it); | 5160 bidi_move_to_visually_next (&it->bidi_it); |
5582 it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); | 5582 it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); |
5583 it->sp = 0; | 5583 it->sp = 0; |
5584 it->string_from_display_prop_p = 0; | 5584 it->string_from_display_prop_p = 0; |
5585 it->face_before_selective_p = 0; | 5585 it->face_before_selective_p = 0; |
5586 if (it->bidi_p) | 5586 if (it->bidi_p) |
5587 it->bidi_it.first_elt = 1; | 5587 { |
5588 it->bidi_it.first_elt = 1; | |
5589 it->bidi_it.paragraph_dir = NEUTRAL_DIR; | |
5590 } | |
5588 | 5591 |
5589 if (set_stop_p) | 5592 if (set_stop_p) |
5590 { | 5593 { |
5591 it->stop_charpos = CHARPOS (pos); | 5594 it->stop_charpos = CHARPOS (pos); |
5592 it->base_level_stop = CHARPOS (pos); | 5595 it->base_level_stop = CHARPOS (pos); |
6673 || FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' | 6676 || FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' |
6674 || FETCH_CHAR (it->bidi_it.bytepos) == '\n') | 6677 || FETCH_CHAR (it->bidi_it.bytepos) == '\n') |
6675 { | 6678 { |
6676 /* If we are at the beginning of a line, we can produce the | 6679 /* If we are at the beginning of a line, we can produce the |
6677 next element right away. */ | 6680 next element right away. */ |
6678 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); | 6681 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); |
6679 bidi_move_to_visually_next (&it->bidi_it); | 6682 bidi_move_to_visually_next (&it->bidi_it); |
6680 } | 6683 } |
6681 else | 6684 else |
6682 { | 6685 { |
6683 EMACS_INT orig_bytepos = IT_BYTEPOS (*it); | 6686 EMACS_INT orig_bytepos = IT_BYTEPOS (*it); |
6687 element. */ | 6690 element. */ |
6688 IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it), -1); | 6691 IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it), -1); |
6689 IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); | 6692 IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); |
6690 it->bidi_it.charpos = IT_CHARPOS (*it); | 6693 it->bidi_it.charpos = IT_CHARPOS (*it); |
6691 it->bidi_it.bytepos = IT_BYTEPOS (*it); | 6694 it->bidi_it.bytepos = IT_BYTEPOS (*it); |
6692 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); | 6695 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); |
6693 do | 6696 do |
6694 { | 6697 { |
6695 /* Now return to buffer position where we were asked to | 6698 /* Now return to buffer position where we were asked to |
6696 get the next display element, and produce that. */ | 6699 get the next display element, and produce that. */ |
6697 bidi_move_to_visually_next (&it->bidi_it); | 6700 bidi_move_to_visually_next (&it->bidi_it); |