aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2010-05-15 16:23:48 +0300
committerEli Zaretskii <[email protected]>2010-05-15 16:23:48 +0300
commitd20e1419fda6f29478d79f69db8e128d043d4ee1 (patch)
tree6c3d55edc1c753f3578111b10802397974fc61cc /src/bidi.c
parent98d8b17e45bb1246df61e51f8917b98faa9f1cdd (diff)
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bidi.c b/src/bidi.c
index c4cb4c599d..6939e51159 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;