From: Eli Zaretskii Date: Fri, 1 Jan 2010 11:49:38 +0000 (-0500) Subject: Retrospective commit from 2009-10-31. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~635^2~46 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=93ba079d4e180e94145297f1959f31115ec3a92c;p=emacs.git Retrospective commit from 2009-10-31. Continue debugging set_cursor_from_row. Continue debugging display of R2L glyph rows. xdisp.c (display_line): Always extend reversed_p rows to the end of line. (set_cursor_from_row): In R2L rows that don't display text, put the cursor on the rightmost glyph. --- diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index d4146e4c2e6..0df409481a7 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi @@ -1,3 +1,10 @@ +2009-10-31 Eli Zaretskii + + * xdisp.c (display_line): Always extend reversed_p rows to the end + of line. + (set_cursor_from_row): In R2L rows that don't display text, put + the cursor on the rightmost glyph. + 2009-10-24 Eli Zaretskii * xdisp.c (set_cursor_from_row): Fix off-by-one error when diff --git a/src/xdisp.c b/src/xdisp.c index b44ce759870..6b2e046b82b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6575,8 +6575,6 @@ next_element_from_buffer (it) be reversed. */ if (it->glyph_row && (it->bidi_it.level_stack[0].level & 1) != 0) it->glyph_row->reversed_p = 1; - if (it->glyph_row && (it->bidi_it.level_stack[0].level & 1) != 0) - it->glyph_row->reversed_p = 1; bidi_get_next_char_visually (&it->bidi_it); } else @@ -12527,6 +12525,14 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) glyph_after = end; } } + else if (row->reversed_p) + { + /* In R2L rows that don't display text, put the cursor on the + rightmost glyph. Case in point: an empty last line that is + part of an R2L paragraph. */ + cursor = end - 1; + x = -1; /* will be computed below, at lable compute_x */ + } /* Step 1: Try to find the glyph whose character position corresponds to point. If that's not possible, find 2 glyphs @@ -12701,6 +12707,9 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) cprop = Fget_char_property (make_number (gpos), Qcursor, glyph->object); + /* FIXME: This loses the feature of the + unidirectional redisplay when the + property value was an integer. */ if (!NILP (cprop)) { cursor = glyph; @@ -16529,7 +16538,6 @@ extend_face_to_end_of_line (it) Lisp_Object saved_object; enum display_element_type saved_what = it->what; int saved_face_id = it->face_id; - int text_len = it->glyph_row->used[TEXT_AREA]; saved_object = it->object; saved_pos = it->position; @@ -16905,6 +16913,11 @@ display_line (it) it->continuation_lines_width = 0; row->ends_at_zv_p = 1; + /* A row that displays right-to-left text must always have + its last face extended all the way to the end of line, + even if this row ends in ZV. */ + if (row->reversed_p) + extend_face_to_end_of_line (it); row_end = it->current; break; }