diff src/xdisp.c @ 107584:e0df0337f248

Retrospective commit from 2009-08-15. Start of work on bidi Emacs 23/24. bidi.c (bidi_initialize): Fix initialization of bidi_type_table. xdisp.c (set_iterator_to_next): Fix position setting after call to bidi_get_next_char_visually. bidi.c: Include stdio.h unconditionally. Fix and elaborate commentary. Add Copyright blurb.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 31 Dec 2009 15:04:11 -0500
parents f35e7896a0fe
children cbca7f94b057
line wrap: on
line diff
--- a/src/xdisp.c	Thu Dec 31 14:44:59 2009 -0500
+++ b/src/xdisp.c	Thu Dec 31 15:04:11 2009 -0500
@@ -2658,8 +2658,8 @@
   /* Are multibyte characters enabled in current_buffer?  */
   it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
 
-  /* Do we need multibyte processing?  */
-  it->bidi_p = !NILP (current_buffer->enable_bidi_display);
+  /* Do we need to reorded bidirectional text?  */
+  it->bidi_p = !NILP (current_buffer->bidi_display_reordering);
 
   /* Non-zero if we should highlight the region.  */
   highlight_region_p
@@ -5520,6 +5520,11 @@
 
   if (it->bidi_p)
     {
+      /* FIXME: L2R below is just for easyness of testing, as we
+	 currently support only left-to-right paragraphs.  The value
+	 should be user-definable and/or come from some ``higher
+	 protocol''. In the absence of any other guidance, the default
+	 for this initialization should be NEUTRAL_DIR.  */
       bidi_init_it (pos.charpos - 1, L2R, &it->bidi_it);
       bidi_get_next_char_visually (&it->bidi_it);
 
@@ -6100,8 +6105,8 @@
 	  else
 	    {
 	      bidi_get_next_char_visually (&it->bidi_it);
-	      IT_BYTEPOS (*it) = it->bidi_it.charpos;
-	      IT_CHARPOS (*it) = it->bidi_it.bytepos;
+	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+	      IT_CHARPOS (*it) = it->bidi_it.charpos;
 	    }
 	  xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
 	}