diff options
author | Eli Zaretskii <eliz@gnu.org> | 2010-05-15 16:23:48 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2010-05-15 16:23:48 +0300 |
commit | d20e1419fda6f29478d79f69db8e128d043d4ee1 (patch) | |
tree | 6c3d55edc1c753f3578111b10802397974fc61cc /src/bidi.c | |
parent | 98d8b17e45bb1246df61e51f8917b98faa9f1cdd (diff) | |
download | emacs-d20e1419fda6f29478d79f69db8e128d043d4ee1.tar.gz |
Implement bidi-sensitive movement with arrow keys.
src/bidi.c (bidi_paragraph_init): Don't leave alone garbage values
of bidi_it->paragraph_dir. Call bidi_initialize if needed.
src/xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
(syms_of_xdisp): Defsubr it.
src/cmds.c (Fforward_char, Fbackward_char): Doc fix.
src/subr.el (right-arrow-command, left-arrow-command): New functions.
src/bindings.el (global-map): Bind them to right and left arrow keys.
etc/NEWS: Mention current-bidi-paragraph-direction
Diffstat (limited to 'src/bidi.c')
-rw-r--r-- | src/bidi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bidi.c b/src/bidi.c index c4cb4c599df..6939e51159f 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -890,6 +890,9 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it) EMACS_INT pos; bidi_type_t type; + if (!bidi_initialized) + bidi_initialize (); + /* If we are inside a paragraph separator, we are just waiting for the separator to be exhausted; use the previous paragraph direction. But don't do that if we have been just reseated, @@ -957,7 +960,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it) /* Contrary to UAX#9 clause P3, we only default the paragraph direction to L2R if we have no previous usable paragraph direction. */ - if (bidi_it->paragraph_dir == NEUTRAL_DIR) + if (bidi_it->paragraph_dir != L2R && bidi_it->paragraph_dir != R2L) bidi_it->paragraph_dir = L2R; /* P3 and ``higher protocols'' */ if (bidi_it->paragraph_dir == R2L) bidi_it->level_stack[0].level = 1; |