Rename find_next_newline to find_newline_no_quit.
[bpt/emacs.git] / src / bidi.c
index 364d7e5..cf5e580 100644 (file)
@@ -1108,7 +1108,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte)
        display string?  And what if a display string covering some
        of the text over which we scan back includes
        paragraph_start_re?  */
-    pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte);
+    pos = find_newline_no_quit (pos - 1, -1, &pos_byte);
   if (n >= MAX_PARAGRAPH_SEARCH)
     pos_byte = BEGV_BYTE;
   return pos_byte;
@@ -1353,15 +1353,19 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
               : bidi_it->string.s);
 
          if (bidi_it->charpos < 0)
-           bidi_it->charpos = 0;
-         bidi_it->bytepos = bidi_count_bytes (p, 0, 0, bidi_it->charpos,
-                                              bidi_it->string.unibyte);
+           bidi_it->charpos = bidi_it->bytepos = 0;
+         eassert (bidi_it->bytepos == bidi_count_bytes (p, 0, 0,
+                                                        bidi_it->charpos,
+                                                        bidi_it->string.unibyte));
        }
       else
        {
          if (bidi_it->charpos < BEGV)
-           bidi_it->charpos = BEGV;
-         bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos);
+           {
+             bidi_it->charpos = BEGV;
+             bidi_it->bytepos = BEGV_BYTE;
+           }
+         eassert (bidi_it->bytepos == CHAR_TO_BYTE (bidi_it->charpos));
        }
     }
   /* Don't move at end of buffer/string.  */