diff options
| author | Eli Zaretskii | 2009-12-31 15:56:07 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2009-12-31 15:56:07 -0500 |
| commit | a88bbf05709b0ac38669479a80465f7334fa62b2 (patch) | |
| tree | 9313dff2e23599bd844b4bdff6b2f2efe9358637 | |
| parent | 2d6e4628e97051ce2aedff5d8b6e14903639d808 (diff) | |
| download | emacs-a88bbf05709b0ac38669479a80465f7334fa62b2.tar.gz emacs-a88bbf05709b0ac38669479a80465f7334fa62b2.zip | |
Retrospective commit from 2009-08-29.
Started working on cursor motion.
xdisp.c (set_cursor_from_row): Don't assume glyph->charpos
increments linearly.
(try_window_reusing_current_matrix): Don't assume glyph->charpos
increments linearly.
bidi.c <bidi_overriding_paragraph_direction>: Default to L2R, for now.
| -rw-r--r-- | src/ChangeLog.bidi | 12 | ||||
| -rw-r--r-- | src/bidi.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 28 |
3 files changed, 40 insertions, 3 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index eab5642cb14..c36ab231fa8 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2009-08-29 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Don't assume glyph->charpos | ||
| 4 | increments linearly. | ||
| 5 | (try_window_reusing_current_matrix): Don't assume glyph->charpos | ||
| 6 | increments linearly. | ||
| 7 | |||
| 8 | 2009-08-28 Eli Zaretskii <eliz@gnu.org> | ||
| 9 | |||
| 10 | * bidi.c <bidi_overriding_paragraph_direction>: Default to L2R, | ||
| 11 | for now. | ||
| 12 | |||
| 1 | 2009-08-22 Eli Zaretskii <eliz@gnu.org> | 13 | 2009-08-22 Eli Zaretskii <eliz@gnu.org> |
| 2 | 14 | ||
| 3 | * bidi.c (bidi_initialize): staticpro bidi_char_table. | 15 | * bidi.c (bidi_initialize): staticpro bidi_char_table. |
diff --git a/src/bidi.c b/src/bidi.c index 697909ae8be..e558b732f40 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -155,7 +155,8 @@ typedef enum { | |||
| 155 | 155 | ||
| 156 | int bidi_ignore_explicit_marks_for_paragraph_level = 1; | 156 | int bidi_ignore_explicit_marks_for_paragraph_level = 1; |
| 157 | 157 | ||
| 158 | bidi_dir_t bidi_overriding_paragraph_direction = NEUTRAL_DIR; | 158 | /* FIXME: Should be user-definable. */ |
| 159 | bidi_dir_t bidi_overriding_paragraph_direction = L2R; | ||
| 159 | 160 | ||
| 160 | /* FIXME: Unused? */ | 161 | /* FIXME: Unused? */ |
| 161 | #define ASCII_BIDI_TYPE_SET(STR, TYPE) \ | 162 | #define ASCII_BIDI_TYPE_SET(STR, TYPE) \ |
diff --git a/src/xdisp.c b/src/xdisp.c index bd9300a40a2..54ac640da64 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12377,7 +12377,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12377 | while (glyph < end | 12377 | while (glyph < end |
| 12378 | && !INTEGERP (glyph->object) | 12378 | && !INTEGERP (glyph->object) |
| 12379 | && (!BUFFERP (glyph->object) | 12379 | && (!BUFFERP (glyph->object) |
| 12380 | || (last_pos = glyph->charpos) < pt_old | 12380 | || (last_pos = glyph->charpos) != pt_old |
| 12381 | || glyph->avoid_cursor_p)) | 12381 | || glyph->avoid_cursor_p)) |
| 12382 | { | 12382 | { |
| 12383 | if (! STRINGP (glyph->object)) | 12383 | if (! STRINGP (glyph->object)) |
| @@ -14497,15 +14497,39 @@ try_window_reusing_current_matrix (w) | |||
| 14497 | { | 14497 | { |
| 14498 | struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; | 14498 | struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; |
| 14499 | struct glyph *end = glyph + row->used[TEXT_AREA]; | 14499 | struct glyph *end = glyph + row->used[TEXT_AREA]; |
| 14500 | struct glyph *orig_glyph = glyph; | ||
| 14501 | struct cursor_pos orig_cursor = w->cursor; | ||
| 14500 | 14502 | ||
| 14501 | for (; glyph < end | 14503 | for (; glyph < end |
| 14502 | && (!BUFFERP (glyph->object) | 14504 | && (!BUFFERP (glyph->object) |
| 14503 | || glyph->charpos < PT); | 14505 | || glyph->charpos != PT); |
| 14504 | glyph++) | 14506 | glyph++) |
| 14505 | { | 14507 | { |
| 14506 | w->cursor.hpos++; | 14508 | w->cursor.hpos++; |
| 14507 | w->cursor.x += glyph->pixel_width; | 14509 | w->cursor.x += glyph->pixel_width; |
| 14508 | } | 14510 | } |
| 14511 | /* With bidi reordering, charpos changes non-linearly | ||
| 14512 | with hpos, so the right glyph could be to the | ||
| 14513 | left. */ | ||
| 14514 | if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering) | ||
| 14515 | && (!BUFFERP (glyph->object) || glyph->charpos != PT)) | ||
| 14516 | { | ||
| 14517 | struct glyph *start_glyph = row->glyphs[TEXT_AREA]; | ||
| 14518 | |||
| 14519 | glyph = orig_glyph - 1; | ||
| 14520 | orig_cursor.hpos--; | ||
| 14521 | orig_cursor.x -= glyph->pixel_width; | ||
| 14522 | for (; glyph >= start_glyph | ||
| 14523 | && (!BUFFERP (glyph->object) | ||
| 14524 | || glyph->charpos != PT); | ||
| 14525 | glyph--) | ||
| 14526 | { | ||
| 14527 | w->cursor.hpos--; | ||
| 14528 | w->cursor.x -= glyph->pixel_width; | ||
| 14529 | } | ||
| 14530 | if (BUFFERP (glyph->object) && glyph->charpos == PT) | ||
| 14531 | w->cursor = orig_cursor; | ||
| 14532 | } | ||
| 14509 | } | 14533 | } |
| 14510 | } | 14534 | } |
| 14511 | 14535 | ||