]> git.eshelyaron.com Git - emacs.git/commitdiff
(forward_to_next_line_start): Reset it->c if taking the
authorGerd Moellmann <gerd@gnu.org>
Wed, 3 Jan 2001 19:19:39 +0000 (19:19 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 3 Jan 2001 19:19:39 +0000 (19:19 +0000)
short cut at the start of the function.  Add an assertion.
(reseat_at_next_visible_line_start): Add an assertion.

src/ChangeLog
src/xdisp.c

index b47b5c695122af7144a7431f44a3eb98560c846e..d218f86eeb83c0bc21c93aac5c7eec1df119e63a 100644 (file)
@@ -1,5 +1,9 @@
 2001-01-03  Gerd Moellmann  <gerd@gnu.org>
 
+       * xdisp.c (forward_to_next_line_start): Reset it->c if taking the
+       short cut at the start of the function.  Add an assertion.
+       (reseat_at_next_visible_line_start): Add an assertion.
+
        * window.c (Frecenter): When changing the window start, set the
        window's window_end_valid to nil.
        (Fwindow_end): Fix window-end computation when UPDATE is non-nil.
index 3e9790d1b8e1e98696c092a39c111199d5050607..d4f25661e08869ca28b6ff02a0c28068d203b8ad 100644 (file)
@@ -3494,6 +3494,7 @@ forward_to_next_line_start (it, skipped_p)
   if (it->what == IT_CHARACTER && it->c == '\n')
     {
       set_iterator_to_next (it, 0);
+      it->c = 0;
       return 1;
     }
 
@@ -3553,6 +3554,7 @@ forward_to_next_line_start (it, skipped_p)
     }
 
   it->selective = old_selective;
+  xassert (!newline_found_p || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
   return newline_found_p;
 }
 
@@ -3642,9 +3644,12 @@ reseat_at_next_visible_line_start (it, on_newline_p)
      more than the value of IT->selective.  */
   if (it->selective > 0)
     while (IT_CHARPOS (*it) < ZV
-           && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
+          && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
                                 it->selective))
-      newline_found_p = forward_to_next_line_start (it, &skipped_p);
+      {
+       xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
+       newline_found_p = forward_to_next_line_start (it, &skipped_p);
+      }
 
   /* Position on the newline if that's what's requested.  */
   if (on_newline_p && newline_found_p)