From ae5e04fabcf5b6099aa8e1974566cad715e535f7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 10 May 2010 21:40:26 +0300 Subject: [PATCH] Fix a crash when visiting image files in bidi mode. xdisp.c (init_iterator): Don't turn on bidi reordering in unibyte buffers. See http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00263.html for the details. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c0e37f70c9c..018d4d1c418 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-05-10 Eli Zaretskii + + * xdisp.c (init_iterator): Don't turn on bidi reordering in + unibyte buffers. See + http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00263.html. + 2010-05-10 Glenn Morris * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp. diff --git a/src/xdisp.c b/src/xdisp.c index 1e16180f7c9..92478b8e1f9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2698,8 +2698,12 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) /* Are multibyte characters enabled in current_buffer? */ it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); - /* Do we need to reorder bidirectional text? */ - it->bidi_p = !NILP (current_buffer->bidi_display_reordering); + /* Do we need to reorder bidirectional text? Not if this is a + unibyte buffer: all single-byte characters are by definition + strong L2R, so no reordering is needed. And bidi.c doesn't + support unibyte buffers anyway. */ + it->bidi_p + = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p; /* Non-zero if we should highlight the region. */ highlight_region_p -- 2.39.2