From: Eli Zaretskii Date: Mon, 10 May 2010 18:40:26 +0000 (+0300) Subject: Fix a crash when visiting image files in bidi mode. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~211^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae5e04fabcf5b6099aa8e1974566cad715e535f7;p=emacs.git 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. --- 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