diff options
| -rw-r--r-- | src/ChangeLog.bidi | 2 | ||||
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 118 |
4 files changed, 59 insertions, 67 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 515f74b39ea..0a362bb8f00 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | 12 | ||
| 13 | 2009-09-11 Eli Zaretskii <eliz@gnu.org> | 13 | 2009-09-11 Eli Zaretskii <eliz@gnu.org> |
| 14 | 14 | ||
| 15 | Note: The following changes were undone on 2009-09-12. | ||
| 16 | |||
| 15 | * xdisp.c (set_iterator_to_next, reseat, reseat_1) | 17 | * xdisp.c (set_iterator_to_next, reseat, reseat_1) |
| 16 | (reseat_at_next_visible_line_start): Accept additional argument | 18 | (reseat_at_next_visible_line_start): Accept additional argument |
| 17 | force_logical_p; all callers changed. If force_logical_p is | 19 | force_logical_p; all callers changed. If force_logical_p is |
diff --git a/src/dispextern.h b/src/dispextern.h index 36533a3f4c5..f601fee7df2 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2825,7 +2825,7 @@ void init_iterator P_ ((struct it *, struct window *, int, | |||
| 2825 | void init_iterator_to_row_start P_ ((struct it *, struct window *, | 2825 | void init_iterator_to_row_start P_ ((struct it *, struct window *, |
| 2826 | struct glyph_row *)); | 2826 | struct glyph_row *)); |
| 2827 | int get_next_display_element P_ ((struct it *)); | 2827 | int get_next_display_element P_ ((struct it *)); |
| 2828 | void set_iterator_to_next P_ ((struct it *, int, int)); | 2828 | void set_iterator_to_next P_ ((struct it *, int)); |
| 2829 | void start_display P_ ((struct it *, struct window *, struct text_pos)); | 2829 | void start_display P_ ((struct it *, struct window *, struct text_pos)); |
| 2830 | void move_it_to P_ ((struct it *, int, int, int, int, int)); | 2830 | void move_it_to P_ ((struct it *, int, int, int, int, int)); |
| 2831 | void move_it_vertically P_ ((struct it *, int)); | 2831 | void move_it_vertically P_ ((struct it *, int)); |
diff --git a/src/dispnew.c b/src/dispnew.c index d74462d31b8..b5764ac7fe3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3612,7 +3612,7 @@ direct_output_for_insert (g) | |||
| 3612 | 3612 | ||
| 3613 | delta += 1; | 3613 | delta += 1; |
| 3614 | delta_bytes += it.len; | 3614 | delta_bytes += it.len; |
| 3615 | set_iterator_to_next (&it, 1, 0); | 3615 | set_iterator_to_next (&it, 1); |
| 3616 | } | 3616 | } |
| 3617 | 3617 | ||
| 3618 | /* Give up if we hit the right edge of the window. We would have | 3618 | /* Give up if we hit the right edge of the window. We would have |
| @@ -3630,7 +3630,7 @@ direct_output_for_insert (g) | |||
| 3630 | { | 3630 | { |
| 3631 | if (it2.c == '\t') | 3631 | if (it2.c == '\t') |
| 3632 | return 0; | 3632 | return 0; |
| 3633 | set_iterator_to_next (&it2, 1, 0); | 3633 | set_iterator_to_next (&it2, 1); |
| 3634 | } | 3634 | } |
| 3635 | 3635 | ||
| 3636 | /* Number of new glyphs produced. */ | 3636 | /* Number of new glyphs produced. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 947a743ae70..cbe9b2c5b2b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -963,11 +963,11 @@ static void run_redisplay_end_trigger_hook P_ ((struct it *)); | |||
| 963 | static int get_overlay_strings P_ ((struct it *, int)); | 963 | static int get_overlay_strings P_ ((struct it *, int)); |
| 964 | static int get_overlay_strings_1 P_ ((struct it *, int, int)); | 964 | static int get_overlay_strings_1 P_ ((struct it *, int, int)); |
| 965 | static void next_overlay_string P_ ((struct it *)); | 965 | static void next_overlay_string P_ ((struct it *)); |
| 966 | static void reseat P_ ((struct it *, struct text_pos, int, int)); | 966 | static void reseat P_ ((struct it *, struct text_pos, int)); |
| 967 | static void reseat_1 P_ ((struct it *, struct text_pos, int, int)); | 967 | static void reseat_1 P_ ((struct it *, struct text_pos, int)); |
| 968 | static void back_to_previous_visible_line_start P_ ((struct it *)); | 968 | static void back_to_previous_visible_line_start P_ ((struct it *)); |
| 969 | void reseat_at_previous_visible_line_start P_ ((struct it *)); | 969 | void reseat_at_previous_visible_line_start P_ ((struct it *)); |
| 970 | static void reseat_at_next_visible_line_start P_ ((struct it *, int, int)); | 970 | static void reseat_at_next_visible_line_start P_ ((struct it *, int)); |
| 971 | static int next_element_from_ellipsis P_ ((struct it *)); | 971 | static int next_element_from_ellipsis P_ ((struct it *)); |
| 972 | static int next_element_from_display_vector P_ ((struct it *)); | 972 | static int next_element_from_display_vector P_ ((struct it *)); |
| 973 | static int next_element_from_string P_ ((struct it *)); | 973 | static int next_element_from_string P_ ((struct it *)); |
| @@ -2823,7 +2823,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 2823 | it->start = it->current; | 2823 | it->start = it->current; |
| 2824 | 2824 | ||
| 2825 | /* Compute faces etc. */ | 2825 | /* Compute faces etc. */ |
| 2826 | reseat (it, it->current.pos, 1, 0); | 2826 | reseat (it, it->current.pos, 1); |
| 2827 | } | 2827 | } |
| 2828 | 2828 | ||
| 2829 | CHECK_IT (it); | 2829 | CHECK_IT (it); |
| @@ -2883,7 +2883,7 @@ start_display (it, w, pos) | |||
| 2883 | if (it->current.dpvec_index >= 0 | 2883 | if (it->current.dpvec_index >= 0 |
| 2884 | || it->current.overlay_string_index >= 0) | 2884 | || it->current.overlay_string_index >= 0) |
| 2885 | { | 2885 | { |
| 2886 | set_iterator_to_next (it, 1, 0); | 2886 | set_iterator_to_next (it, 1); |
| 2887 | move_it_in_display_line_to (it, -1, -1, 0); | 2887 | move_it_in_display_line_to (it, -1, -1, 0); |
| 2888 | } | 2888 | } |
| 2889 | 2889 | ||
| @@ -5242,7 +5242,7 @@ forward_to_next_line_start (it, skipped_p) | |||
| 5242 | && it->c == '\n' | 5242 | && it->c == '\n' |
| 5243 | && CHARPOS (it->position) == IT_CHARPOS (*it)) | 5243 | && CHARPOS (it->position) == IT_CHARPOS (*it)) |
| 5244 | { | 5244 | { |
| 5245 | set_iterator_to_next (it, 0, 0); | 5245 | set_iterator_to_next (it, 0); |
| 5246 | it->c = 0; | 5246 | it->c = 0; |
| 5247 | return 1; | 5247 | return 1; |
| 5248 | } | 5248 | } |
| @@ -5263,7 +5263,7 @@ forward_to_next_line_start (it, skipped_p) | |||
| 5263 | if (!get_next_display_element (it)) | 5263 | if (!get_next_display_element (it)) |
| 5264 | return 0; | 5264 | return 0; |
| 5265 | newline_found_p = it->what == IT_CHARACTER && it->c == '\n'; | 5265 | newline_found_p = it->what == IT_CHARACTER && it->c == '\n'; |
| 5266 | set_iterator_to_next (it, 0, 0); | 5266 | set_iterator_to_next (it, 0); |
| 5267 | } | 5267 | } |
| 5268 | 5268 | ||
| 5269 | /* If we didn't find a newline near enough, see if we can use a | 5269 | /* If we didn't find a newline near enough, see if we can use a |
| @@ -5296,7 +5296,7 @@ forward_to_next_line_start (it, skipped_p) | |||
| 5296 | && !newline_found_p) | 5296 | && !newline_found_p) |
| 5297 | { | 5297 | { |
| 5298 | newline_found_p = ITERATOR_AT_END_OF_LINE_P (it); | 5298 | newline_found_p = ITERATOR_AT_END_OF_LINE_P (it); |
| 5299 | set_iterator_to_next (it, 0, 0); | 5299 | set_iterator_to_next (it, 0); |
| 5300 | } | 5300 | } |
| 5301 | } | 5301 | } |
| 5302 | } | 5302 | } |
| @@ -5397,24 +5397,22 @@ reseat_at_previous_visible_line_start (it) | |||
| 5397 | struct it *it; | 5397 | struct it *it; |
| 5398 | { | 5398 | { |
| 5399 | back_to_previous_visible_line_start (it); | 5399 | back_to_previous_visible_line_start (it); |
| 5400 | reseat (it, it->current.pos, 1, 0); | 5400 | reseat (it, it->current.pos, 1); |
| 5401 | CHECK_IT (it); | 5401 | CHECK_IT (it); |
| 5402 | } | 5402 | } |
| 5403 | 5403 | ||
| 5404 | 5404 | ||
| 5405 | /* Reseat iterator IT on the next visible line start in the current | 5405 | /* Reseat iterator IT on the next visible line start in the current |
| 5406 | buffer. ON_NEWLINE_P non-zero means position IT on the newline | 5406 | buffer. ON_NEWLINE_P non-zero means position IT on the newline |
| 5407 | preceding the line start. FORCE_LOGICAL_P non-zero means force | 5407 | preceding the line start. Skip over invisible text that is so |
| 5408 | iteration in logical order even if we are reordering bidirectional | 5408 | because of selective display. Compute faces, overlays etc at the |
| 5409 | text. Skip over invisible text that is so because of selective | 5409 | new position. Note that this function does not skip over text that |
| 5410 | display. Compute faces, overlays etc at the new position. Note | 5410 | is invisible because of text properties. */ |
| 5411 | that this function does not skip over text that is invisible | ||
| 5412 | because of text properties. */ | ||
| 5413 | 5411 | ||
| 5414 | static void | 5412 | static void |
| 5415 | reseat_at_next_visible_line_start (it, on_newline_p, force_logical_p) | 5413 | reseat_at_next_visible_line_start (it, on_newline_p) |
| 5416 | struct it *it; | 5414 | struct it *it; |
| 5417 | int on_newline_p, force_logical_p; | 5415 | int on_newline_p; |
| 5418 | { | 5416 | { |
| 5419 | int newline_found_p, skipped_p = 0; | 5417 | int newline_found_p, skipped_p = 0; |
| 5420 | 5418 | ||
| @@ -5445,16 +5443,13 @@ reseat_at_next_visible_line_start (it, on_newline_p, force_logical_p) | |||
| 5445 | } | 5443 | } |
| 5446 | else if (IT_CHARPOS (*it) > BEGV) | 5444 | else if (IT_CHARPOS (*it) > BEGV) |
| 5447 | { | 5445 | { |
| 5448 | if (on_newline_p | ||
| 5449 | && !(force_logical_p || !it->bidi_p)) | ||
| 5450 | abort (); | ||
| 5451 | --IT_CHARPOS (*it); | 5446 | --IT_CHARPOS (*it); |
| 5452 | --IT_BYTEPOS (*it); | 5447 | --IT_BYTEPOS (*it); |
| 5453 | reseat (it, it->current.pos, 0, 1); | 5448 | reseat (it, it->current.pos, 0); |
| 5454 | } | 5449 | } |
| 5455 | } | 5450 | } |
| 5456 | else if (skipped_p) | 5451 | else if (skipped_p) |
| 5457 | reseat (it, it->current.pos, 0, force_logical_p); | 5452 | reseat (it, it->current.pos, 0); |
| 5458 | 5453 | ||
| 5459 | CHECK_IT (it); | 5454 | CHECK_IT (it); |
| 5460 | } | 5455 | } |
| @@ -5468,19 +5463,17 @@ reseat_at_next_visible_line_start (it, on_newline_p, force_logical_p) | |||
| 5468 | /* Change IT's current position to POS in current_buffer. If FORCE_P | 5463 | /* Change IT's current position to POS in current_buffer. If FORCE_P |
| 5469 | is non-zero, always check for text properties at the new position. | 5464 | is non-zero, always check for text properties at the new position. |
| 5470 | Otherwise, text properties are only looked up if POS >= | 5465 | Otherwise, text properties are only looked up if POS >= |
| 5471 | IT->check_charpos of a property. If FORCE_LOGICAL_P is non-zero, | 5466 | IT->check_charpos of a property. */ |
| 5472 | force iteration in logical order even when reordering bidirectional | ||
| 5473 | text. */ | ||
| 5474 | 5467 | ||
| 5475 | static void | 5468 | static void |
| 5476 | reseat (it, pos, force_p, force_logical_p) | 5469 | reseat (it, pos, force_p) |
| 5477 | struct it *it; | 5470 | struct it *it; |
| 5478 | struct text_pos pos; | 5471 | struct text_pos pos; |
| 5479 | int force_p, force_logical_p; | 5472 | int force_p; |
| 5480 | { | 5473 | { |
| 5481 | int original_pos = IT_CHARPOS (*it); | 5474 | int original_pos = IT_CHARPOS (*it); |
| 5482 | 5475 | ||
| 5483 | reseat_1 (it, pos, 0, force_logical_p); | 5476 | reseat_1 (it, pos, 0); |
| 5484 | 5477 | ||
| 5485 | /* Determine where to check text properties. Avoid doing it | 5478 | /* Determine where to check text properties. Avoid doing it |
| 5486 | where possible because text property lookup is very expensive. */ | 5479 | where possible because text property lookup is very expensive. */ |
| @@ -5494,15 +5487,13 @@ reseat (it, pos, force_p, force_logical_p) | |||
| 5494 | 5487 | ||
| 5495 | 5488 | ||
| 5496 | /* Change IT's buffer position to POS. SET_STOP_P non-zero means set | 5489 | /* Change IT's buffer position to POS. SET_STOP_P non-zero means set |
| 5497 | IT->stop_pos to POS, also. FORCE_LOGICAL_P non-zero means force | 5490 | IT->stop_pos to POS, also. */ |
| 5498 | iteration in logical order even when reordering bidirectional | ||
| 5499 | text. */ | ||
| 5500 | 5491 | ||
| 5501 | static void | 5492 | static void |
| 5502 | reseat_1 (it, pos, set_stop_p, force_logical_p) | 5493 | reseat_1 (it, pos, set_stop_p) |
| 5503 | struct it *it; | 5494 | struct it *it; |
| 5504 | struct text_pos pos; | 5495 | struct text_pos pos; |
| 5505 | int set_stop_p, force_logical_p; | 5496 | int set_stop_p; |
| 5506 | { | 5497 | { |
| 5507 | /* Don't call this function when scanning a C string. */ | 5498 | /* Don't call this function when scanning a C string. */ |
| 5508 | xassert (it->s == NULL); | 5499 | xassert (it->s == NULL); |
| @@ -5527,7 +5518,7 @@ reseat_1 (it, pos, set_stop_p, force_logical_p) | |||
| 5527 | it->string_from_display_prop_p = 0; | 5518 | it->string_from_display_prop_p = 0; |
| 5528 | it->face_before_selective_p = 0; | 5519 | it->face_before_selective_p = 0; |
| 5529 | 5520 | ||
| 5530 | if (it->bidi_p && !force_logical_p) | 5521 | if (it->bidi_p) |
| 5531 | { | 5522 | { |
| 5532 | /* FIXME: L2R below is just for easyness of testing, as we | 5523 | /* FIXME: L2R below is just for easyness of testing, as we |
| 5533 | currently support only left-to-right paragraphs. The value | 5524 | currently support only left-to-right paragraphs. The value |
| @@ -5738,7 +5729,7 @@ get_next_display_element (it) | |||
| 5738 | } | 5729 | } |
| 5739 | else | 5730 | else |
| 5740 | { | 5731 | { |
| 5741 | set_iterator_to_next (it, 0, 0); | 5732 | set_iterator_to_next (it, 0); |
| 5742 | } | 5733 | } |
| 5743 | goto get_next; | 5734 | goto get_next; |
| 5744 | } | 5735 | } |
| @@ -6060,9 +6051,6 @@ get_next_display_element (it) | |||
| 6060 | RESEAT_P non-zero means if called on a newline in buffer text, | 6051 | RESEAT_P non-zero means if called on a newline in buffer text, |
| 6061 | skip to the next visible line start. | 6052 | skip to the next visible line start. |
| 6062 | 6053 | ||
| 6063 | FORCE_LOGICAL_P non-zero means force iteration in logical order | ||
| 6064 | even when reordering bidirectional text. | ||
| 6065 | |||
| 6066 | Functions get_next_display_element and set_iterator_to_next are | 6054 | Functions get_next_display_element and set_iterator_to_next are |
| 6067 | separate because I find this arrangement easier to handle than a | 6055 | separate because I find this arrangement easier to handle than a |
| 6068 | get_next_display_element function that also increments IT's | 6056 | get_next_display_element function that also increments IT's |
| @@ -6074,9 +6062,9 @@ get_next_display_element (it) | |||
| 6074 | decrement position function which would not be easy to write. */ | 6062 | decrement position function which would not be easy to write. */ |
| 6075 | 6063 | ||
| 6076 | void | 6064 | void |
| 6077 | set_iterator_to_next (it, reseat_p, force_logical_p) | 6065 | set_iterator_to_next (it, reseat_p) |
| 6078 | struct it *it; | 6066 | struct it *it; |
| 6079 | int reseat_p, force_logical_p; | 6067 | int reseat_p; |
| 6080 | { | 6068 | { |
| 6081 | /* Reset flags indicating start and end of a sequence of characters | 6069 | /* Reset flags indicating start and end of a sequence of characters |
| 6082 | with box. Reset them at the start of this function because | 6070 | with box. Reset them at the start of this function because |
| @@ -6090,7 +6078,7 @@ set_iterator_to_next (it, reseat_p, force_logical_p) | |||
| 6090 | current_buffer. Advance in the buffer, and maybe skip over | 6078 | current_buffer. Advance in the buffer, and maybe skip over |
| 6091 | invisible lines that are so because of selective display. */ | 6079 | invisible lines that are so because of selective display. */ |
| 6092 | if (ITERATOR_AT_END_OF_LINE_P (it) && reseat_p) | 6080 | if (ITERATOR_AT_END_OF_LINE_P (it) && reseat_p) |
| 6093 | reseat_at_next_visible_line_start (it, 0, force_logical_p); | 6081 | reseat_at_next_visible_line_start (it, 0); |
| 6094 | else if (it->cmp_it.id >= 0) | 6082 | else if (it->cmp_it.id >= 0) |
| 6095 | { | 6083 | { |
| 6096 | IT_CHARPOS (*it) += it->cmp_it.nchars; | 6084 | IT_CHARPOS (*it) += it->cmp_it.nchars; |
| @@ -6109,7 +6097,7 @@ set_iterator_to_next (it, reseat_p, force_logical_p) | |||
| 6109 | { | 6097 | { |
| 6110 | xassert (it->len != 0); | 6098 | xassert (it->len != 0); |
| 6111 | 6099 | ||
| 6112 | if (!(it->bidi_p && !force_logical_p)) | 6100 | if (!it->bidi_p) |
| 6113 | { | 6101 | { |
| 6114 | IT_BYTEPOS (*it) += it->len; | 6102 | IT_BYTEPOS (*it) += it->len; |
| 6115 | IT_CHARPOS (*it) += 1; | 6103 | IT_CHARPOS (*it) += 1; |
| @@ -6160,14 +6148,14 @@ set_iterator_to_next (it, reseat_p, force_logical_p) | |||
| 6160 | 6148 | ||
| 6161 | /* Skip over characters which were displayed via IT->dpvec. */ | 6149 | /* Skip over characters which were displayed via IT->dpvec. */ |
| 6162 | if (it->dpvec_char_len < 0) | 6150 | if (it->dpvec_char_len < 0) |
| 6163 | reseat_at_next_visible_line_start (it, 1, 1); | 6151 | reseat_at_next_visible_line_start (it, 1); |
| 6164 | else if (it->dpvec_char_len > 0) | 6152 | else if (it->dpvec_char_len > 0) |
| 6165 | { | 6153 | { |
| 6166 | if (it->method == GET_FROM_STRING | 6154 | if (it->method == GET_FROM_STRING |
| 6167 | && it->n_overlay_strings > 0) | 6155 | && it->n_overlay_strings > 0) |
| 6168 | it->ignore_overlay_strings_at_pos_p = 1; | 6156 | it->ignore_overlay_strings_at_pos_p = 1; |
| 6169 | it->len = it->dpvec_char_len; | 6157 | it->len = it->dpvec_char_len; |
| 6170 | set_iterator_to_next (it, reseat_p, 0); | 6158 | set_iterator_to_next (it, reseat_p); |
| 6171 | } | 6159 | } |
| 6172 | 6160 | ||
| 6173 | /* Maybe recheck faces after display vector */ | 6161 | /* Maybe recheck faces after display vector */ |
| @@ -6473,7 +6461,7 @@ next_element_from_ellipsis (it) | |||
| 6473 | it->saved_face_id = it->face_id; | 6461 | it->saved_face_id = it->face_id; |
| 6474 | it->method = GET_FROM_BUFFER; | 6462 | it->method = GET_FROM_BUFFER; |
| 6475 | it->object = it->w->buffer; | 6463 | it->object = it->w->buffer; |
| 6476 | reseat_at_next_visible_line_start (it, 1, 1); | 6464 | reseat_at_next_visible_line_start (it, 1); |
| 6477 | it->face_before_selective_p = 1; | 6465 | it->face_before_selective_p = 1; |
| 6478 | } | 6466 | } |
| 6479 | 6467 | ||
| @@ -6861,7 +6849,7 @@ move_it_in_display_line_to (struct it *it, | |||
| 6861 | 6849 | ||
| 6862 | if (it->area != TEXT_AREA) | 6850 | if (it->area != TEXT_AREA) |
| 6863 | { | 6851 | { |
| 6864 | set_iterator_to_next (it, 1, 0); | 6852 | set_iterator_to_next (it, 1); |
| 6865 | continue; | 6853 | continue; |
| 6866 | } | 6854 | } |
| 6867 | 6855 | ||
| @@ -6969,7 +6957,7 @@ move_it_in_display_line_to (struct it *it, | |||
| 6969 | } | 6957 | } |
| 6970 | } | 6958 | } |
| 6971 | 6959 | ||
| 6972 | set_iterator_to_next (it, 1, 0); | 6960 | set_iterator_to_next (it, 1); |
| 6973 | /* On graphical terminals, newlines may | 6961 | /* On graphical terminals, newlines may |
| 6974 | "overflow" into the fringe if | 6962 | "overflow" into the fringe if |
| 6975 | overflow-newline-into-fringe is non-nil. | 6963 | overflow-newline-into-fringe is non-nil. |
| @@ -7065,7 +7053,7 @@ move_it_in_display_line_to (struct it *it, | |||
| 7065 | 7053 | ||
| 7066 | /* The current display element has been consumed. Advance | 7054 | /* The current display element has been consumed. Advance |
| 7067 | to the next. */ | 7055 | to the next. */ |
| 7068 | set_iterator_to_next (it, 1, 0); | 7056 | set_iterator_to_next (it, 1); |
| 7069 | 7057 | ||
| 7070 | /* Stop if lines are truncated and IT's current x-position is | 7058 | /* Stop if lines are truncated and IT's current x-position is |
| 7071 | past the right edge of the window now. */ | 7059 | past the right edge of the window now. */ |
| @@ -7310,13 +7298,13 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 7310 | goto out; | 7298 | goto out; |
| 7311 | 7299 | ||
| 7312 | case MOVE_NEWLINE_OR_CR: | 7300 | case MOVE_NEWLINE_OR_CR: |
| 7313 | set_iterator_to_next (it, 1, 0); | 7301 | set_iterator_to_next (it, 1); |
| 7314 | it->continuation_lines_width = 0; | 7302 | it->continuation_lines_width = 0; |
| 7315 | break; | 7303 | break; |
| 7316 | 7304 | ||
| 7317 | case MOVE_LINE_TRUNCATED: | 7305 | case MOVE_LINE_TRUNCATED: |
| 7318 | it->continuation_lines_width = 0; | 7306 | it->continuation_lines_width = 0; |
| 7319 | reseat_at_next_visible_line_start (it, 0, 0); | 7307 | reseat_at_next_visible_line_start (it, 0); |
| 7320 | if ((op & MOVE_TO_POS) != 0 | 7308 | if ((op & MOVE_TO_POS) != 0 |
| 7321 | && IT_CHARPOS (*it) > to_charpos) | 7309 | && IT_CHARPOS (*it) > to_charpos) |
| 7322 | { | 7310 | { |
| @@ -7342,7 +7330,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 7342 | { | 7330 | { |
| 7343 | line_start_x = it->current_x + it->pixel_width | 7331 | line_start_x = it->current_x + it->pixel_width |
| 7344 | - it->last_visible_x; | 7332 | - it->last_visible_x; |
| 7345 | set_iterator_to_next (it, 0, 0); | 7333 | set_iterator_to_next (it, 0); |
| 7346 | } | 7334 | } |
| 7347 | } | 7335 | } |
| 7348 | else | 7336 | else |
| @@ -7428,7 +7416,7 @@ move_it_vertically_backward (it, dy) | |||
| 7428 | reseat to skip forward over invisible text, set up the iterator | 7416 | reseat to skip forward over invisible text, set up the iterator |
| 7429 | to deliver from overlay strings at the new position etc. So, | 7417 | to deliver from overlay strings at the new position etc. So, |
| 7430 | use reseat_1 here. */ | 7418 | use reseat_1 here. */ |
| 7431 | reseat_1 (it, it->current.pos, 1, 0); | 7419 | reseat_1 (it, it->current.pos, 1); |
| 7432 | 7420 | ||
| 7433 | /* We are now surely at a line start. */ | 7421 | /* We are now surely at a line start. */ |
| 7434 | it->current_x = it->hpos = 0; | 7422 | it->current_x = it->hpos = 0; |
| @@ -7558,7 +7546,7 @@ move_it_past_eol (it) | |||
| 7558 | 7546 | ||
| 7559 | rc = move_it_in_display_line_to (it, Z, 0, MOVE_TO_POS); | 7547 | rc = move_it_in_display_line_to (it, Z, 0, MOVE_TO_POS); |
| 7560 | if (rc == MOVE_NEWLINE_OR_CR) | 7548 | if (rc == MOVE_NEWLINE_OR_CR) |
| 7561 | set_iterator_to_next (it, 0, 0); | 7549 | set_iterator_to_next (it, 0); |
| 7562 | } | 7550 | } |
| 7563 | 7551 | ||
| 7564 | 7552 | ||
| @@ -7587,7 +7575,7 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 7587 | 7575 | ||
| 7588 | pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w); | 7576 | pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w); |
| 7589 | SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos); | 7577 | SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos); |
| 7590 | reseat (it, textpos, 1, 0); | 7578 | reseat (it, textpos, 1); |
| 7591 | it->vpos += pos.vpos; | 7579 | it->vpos += pos.vpos; |
| 7592 | it->current_y += pos.vpos; | 7580 | it->current_y += pos.vpos; |
| 7593 | } | 7581 | } |
| @@ -7623,7 +7611,7 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 7623 | start_charpos = IT_CHARPOS (*it); | 7611 | start_charpos = IT_CHARPOS (*it); |
| 7624 | for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i) | 7612 | for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i) |
| 7625 | back_to_previous_visible_line_start (it); | 7613 | back_to_previous_visible_line_start (it); |
| 7626 | reseat (it, it->current.pos, 1, 0); | 7614 | reseat (it, it->current.pos, 1); |
| 7627 | 7615 | ||
| 7628 | /* Move further back if we end up in a string or an image. */ | 7616 | /* Move further back if we end up in a string or an image. */ |
| 7629 | while (!IT_POS_VALID_AFTER_MOVE_P (it)) | 7617 | while (!IT_POS_VALID_AFTER_MOVE_P (it)) |
| @@ -7637,7 +7625,7 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 7637 | /* If start of line is still in string or image, | 7625 | /* If start of line is still in string or image, |
| 7638 | move further back. */ | 7626 | move further back. */ |
| 7639 | back_to_previous_visible_line_start (it); | 7627 | back_to_previous_visible_line_start (it); |
| 7640 | reseat (it, it->current.pos, 1, 0); | 7628 | reseat (it, it->current.pos, 1); |
| 7641 | dvpos--; | 7629 | dvpos--; |
| 7642 | } | 7630 | } |
| 7643 | 7631 | ||
| @@ -10238,7 +10226,7 @@ display_tool_bar_line (it, height) | |||
| 10238 | if (ITERATOR_AT_END_OF_LINE_P (it)) | 10226 | if (ITERATOR_AT_END_OF_LINE_P (it)) |
| 10239 | break; | 10227 | break; |
| 10240 | 10228 | ||
| 10241 | set_iterator_to_next (it, 1, 0); | 10229 | set_iterator_to_next (it, 1); |
| 10242 | } | 10230 | } |
| 10243 | 10231 | ||
| 10244 | out:; | 10232 | out:; |
| @@ -16699,7 +16687,7 @@ display_line (it) | |||
| 16699 | it->max_phys_ascent + it->max_phys_descent); | 16687 | it->max_phys_ascent + it->max_phys_descent); |
| 16700 | row->extra_line_spacing = max (row->extra_line_spacing, | 16688 | row->extra_line_spacing = max (row->extra_line_spacing, |
| 16701 | it->max_extra_line_spacing); | 16689 | it->max_extra_line_spacing); |
| 16702 | set_iterator_to_next (it, 1, 0); | 16690 | set_iterator_to_next (it, 1); |
| 16703 | continue; | 16691 | continue; |
| 16704 | } | 16692 | } |
| 16705 | 16693 | ||
| @@ -16778,7 +16766,7 @@ display_line (it) | |||
| 16778 | || IT_DISPLAYING_WHITESPACE (it))) | 16766 | || IT_DISPLAYING_WHITESPACE (it))) |
| 16779 | goto back_to_wrap; | 16767 | goto back_to_wrap; |
| 16780 | 16768 | ||
| 16781 | set_iterator_to_next (it, 1, 0); | 16769 | set_iterator_to_next (it, 1); |
| 16782 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) | 16770 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) |
| 16783 | { | 16771 | { |
| 16784 | if (!get_next_display_element (it)) | 16772 | if (!get_next_display_element (it)) |
| @@ -16953,11 +16941,13 @@ display_line (it) | |||
| 16953 | next character in logical order, to set row->end | 16941 | next character in logical order, to set row->end |
| 16954 | correctly below. */ | 16942 | correctly below. */ |
| 16955 | push_it (it); | 16943 | push_it (it); |
| 16956 | set_iterator_to_next (it, 1, 1); | 16944 | it->bidi_p = 0; |
| 16945 | set_iterator_to_next (it, 1); | ||
| 16957 | row_end = it->current; | 16946 | row_end = it->current; |
| 16958 | pop_it (it); | 16947 | pop_it (it); |
| 16948 | it->bidi_p = 1; | ||
| 16959 | } | 16949 | } |
| 16960 | set_iterator_to_next (it, 1, 0); | 16950 | set_iterator_to_next (it, 1); |
| 16961 | it->continuation_lines_width = 0; | 16951 | it->continuation_lines_width = 0; |
| 16962 | if (!it->bidi_p) | 16952 | if (!it->bidi_p) |
| 16963 | row_end = it->current; | 16953 | row_end = it->current; |
| @@ -16966,7 +16956,7 @@ display_line (it) | |||
| 16966 | 16956 | ||
| 16967 | /* Proceed with next display element. Note that this skips | 16957 | /* Proceed with next display element. Note that this skips |
| 16968 | over lines invisible because of selective display. */ | 16958 | over lines invisible because of selective display. */ |
| 16969 | set_iterator_to_next (it, 1, 0); | 16959 | set_iterator_to_next (it, 1); |
| 16970 | 16960 | ||
| 16971 | /* If we truncate lines, we are done when the last displayed | 16961 | /* If we truncate lines, we are done when the last displayed |
| 16972 | glyphs reach past the right margin of the window. */ | 16962 | glyphs reach past the right margin of the window. */ |
| @@ -17010,7 +17000,7 @@ display_line (it) | |||
| 17010 | 17000 | ||
| 17011 | row->truncated_on_right_p = 1; | 17001 | row->truncated_on_right_p = 1; |
| 17012 | it->continuation_lines_width = 0; | 17002 | it->continuation_lines_width = 0; |
| 17013 | reseat_at_next_visible_line_start (it, 0, 0); | 17003 | reseat_at_next_visible_line_start (it, 0); |
| 17014 | row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; | 17004 | row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; |
| 17015 | it->hpos = hpos_before; | 17005 | it->hpos = hpos_before; |
| 17016 | it->current_x = x_before; | 17006 | it->current_x = x_before; |
| @@ -19056,7 +19046,7 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 19056 | break; | 19046 | break; |
| 19057 | } | 19047 | } |
| 19058 | 19048 | ||
| 19059 | set_iterator_to_next (it, 1, 0); | 19049 | set_iterator_to_next (it, 1); |
| 19060 | 19050 | ||
| 19061 | /* Stop if truncating at the right edge. */ | 19051 | /* Stop if truncating at the right edge. */ |
| 19062 | if (it->line_wrap == TRUNCATE | 19052 | if (it->line_wrap == TRUNCATE |