]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a crash when visiting image files in bidi mode.
authorEli Zaretskii <eliz@gnu.org>
Mon, 10 May 2010 18:40:26 +0000 (21:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 10 May 2010 18:40:26 +0000 (21:40 +0300)
 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
src/xdisp.c

index c0e37f70c9c3447d2bbdc7844099757aed000d03..018d4d1c4183cd870f697d221fc37be93d9dc924 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-10  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <rgm@gnu.org>
 
        * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp.
index 1e16180f7c955493cd06448c480caed6add0949c..92478b8e1f9d3c32a8ba5dd652a907be509b107a 100644 (file)
@@ -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