diff options
author | Eli Zaretskii <eliz@gnu.org> | 2010-01-01 10:04:53 -0500 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2010-01-01 10:04:53 -0500 |
commit | 9443b3c70494e010991a11b3be68e4777559df04 (patch) | |
tree | 02a709c69bae6fe9de690b3a8c8402237fbc401c /src/bidi.c | |
parent | bc5a45f315808b1d7335bdc9ea0168b89782c101 (diff) | |
download | emacs-9443b3c70494e010991a11b3be68e4777559df04.tar.gz |
Retrospective commit from 2009-12-26.
Redesign handle_stop_backwards.
Fix character mirroring for non-ASCII characters.
xdisp.c (handle_stop_backwards): Call compute_stop_pos in the
loop, instead of calling handle_stop. Call handle_stop only once,
after the loop.
(next_element_from_buffer): Don't call handle_stop_backwards if at
stop position. If base_level_stop is zero, set it to 1.
term.c (append_glyph): Fill resolved_level and bidi_type slots
of struct glyph for unidirectional display.
xdisp.c (set_cursor_from_row): Handle zero-width characters.
bidi.c (bidi_mirror_char): More efficient code (suggested by
Ehud Karni <ehud@unix.mvs.co.il>). Don't even try to mirror
non-ASCII characters.
Diffstat (limited to 'src/bidi.c')
-rw-r--r-- | src/bidi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/bidi.c b/src/bidi.c index d18629279d6..5abb4ca9f43 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -509,16 +509,13 @@ int bidi_mirror_char (int c) { static const char mirrored_pairs[] = "()<>[]{}"; - const char *p = strchr (mirrored_pairs, c); + const char *p = c > 0 && c < 128 ? strchr (mirrored_pairs, c) : NULL; if (p) { size_t i = p - mirrored_pairs; - if ((i & 1) == 0) - return mirrored_pairs[i + 1]; - else - return mirrored_pairs[i - 1]; + return mirrored_pairs [(i ^ 1)]; } return c; } |