# HG changeset patch # User Eli Zaretskii # Date 1273516826 -10800 # Node ID 3219af501dc0519d96831e741efa5bf6aeccf64e # Parent acaefbe071572dc5ddbded53b5bf37399fc78164 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 -r acaefbe07157 -r 3219af501dc0 src/ChangeLog --- a/src/ChangeLog Mon May 10 17:50:30 2010 +0200 +++ b/src/ChangeLog Mon May 10 21:40:26 2010 +0300 @@ -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 -r acaefbe07157 -r 3219af501dc0 src/xdisp.c --- a/src/xdisp.c Mon May 10 17:50:30 2010 +0200 +++ b/src/xdisp.c Mon May 10 21:40:26 2010 +0300 @@ -2698,8 +2698,12 @@ /* 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