emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xdisp.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Fri, 15 Jul 2005 07:32:16 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.1033 emacs/src/xdisp.c:1.1034
*** emacs/src/xdisp.c:1.1033    Wed Jul 13 10:02:42 2005
--- emacs/src/xdisp.c   Fri Jul 15 11:32:15 2005
***************
*** 5873,5878 ****
--- 5873,5887 ----
             Moving an iterator without producing glyphs
   ***********************************************************************/
  
+ /* Check if iterator is at a position corresponding to a valid buffer
+    position after some move_it_ call.  */
+ 
+ #define IT_POS_VALID_AFTER_MOVE_P(it)                 \
+   ((it)->method == GET_FROM_STRING                    \
+    ? IT_STRING_CHARPOS (*it) == 0                     \
+    : 1)
+ 
+ 
  /* Move iterator IT to a specified buffer or X position within one
     line on the display without producing glyphs.
  
***************
*** 6386,6392 ****
        move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
                  MOVE_TO_POS | MOVE_TO_VPOS);
      }
!   while (it2.method != GET_FROM_BUFFER);
    xassert (IT_CHARPOS (*it) >= BEGV);
    it3 = it2;
  
--- 6395,6401 ----
        move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
                  MOVE_TO_POS | MOVE_TO_VPOS);
      }
!   while (!IT_POS_VALID_AFTER_MOVE_P (&it2));
    xassert (IT_CHARPOS (*it) >= BEGV);
    it3 = it2;
  
***************
*** 6586,6592 ****
    else if (dvpos > 0)
      {
        move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
!       if (it->method != GET_FROM_BUFFER)
        move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
      }
    else
--- 6595,6601 ----
    else if (dvpos > 0)
      {
        move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
!       if (!IT_POS_VALID_AFTER_MOVE_P (it))
        move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
      }
    else
***************
*** 6608,6620 ****
        reseat (it, it->current.pos, 1);
  
        /* Move further back if we end up in a string or an image.  */
!       while (it->method != GET_FROM_BUFFER)
        {
          /* First try to move to start of display line.  */
          dvpos += it->vpos;
          move_it_vertically_backward (it, 0);
          dvpos -= it->vpos;
!         if (it->method == GET_FROM_BUFFER)
            break;
          /* If start of line is still in string or image,
             move further back.  */
--- 6617,6629 ----
        reseat (it, it->current.pos, 1);
  
        /* Move further back if we end up in a string or an image.  */
!       while (!IT_POS_VALID_AFTER_MOVE_P (it))
        {
          /* First try to move to start of display line.  */
          dvpos += it->vpos;
          move_it_vertically_backward (it, 0);
          dvpos -= it->vpos;
!         if (IT_POS_VALID_AFTER_MOVE_P (it))
            break;
          /* If start of line is still in string or image,
             move further back.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]