]> git.eshelyaron.com Git - emacs.git/commitdiff
(move_it_vertically_backward): At the end of the
authorGerd Moellmann <gerd@gnu.org>
Fri, 8 Mar 2002 12:32:02 +0000 (12:32 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 8 Mar 2002 12:32:02 +0000 (12:32 +0000)
function, when moving forward by lines, treat terminal frames
specially.

src/ChangeLog
src/xdisp.c

index 6059351bb37351c02060250f4f3099620470decf..8c5494fb09e7211570bad94e8ccbc809f9aed800 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-08  Gerd Moellmann  <gerd@gnu.org>
+
+       * xdisp.c (move_it_vertically_backward): At the end of the
+       function, when moving forward by lines, treat terminal frames
+       specially.
+
 2002-02-23  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * coding.h (run_pre_post_conversion_on_str): Add prototype.
index 9da2426a93c90ba607d2b71f8eb8c8ca30f36821..eb4070078a523c5de4c6d53ed8ddd37bc2a76a52 100644 (file)
@@ -5396,12 +5396,24 @@ move_it_vertically_backward (it, dy)
       else if (target_y >= it->current_y + line_height
               && IT_CHARPOS (*it) < ZV)
        {
-         /* Should move forward by at least one line, maybe more.  */
-         do
+         /* Should move forward by at least one line, maybe more.
+            
+            Note: Calling move_it_by_lines can be expensive on
+            terminal frames, where compute_motion is used (via
+            vmotion) to do the job, when there are very long lines
+            and truncate-lines is nil.  That's the reason for
+            treating terminal frames specially here.  */
+         
+         if (!FRAME_WINDOW_P (it->f))
+           move_it_vertically (it, target_y - (it->current_y + line_height));
+         else
            {
-             move_it_by_lines (it, 1, 1);
+             do
+               {
+                 move_it_by_lines (it, 1, 1);
+               }
+             while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
            }
-         while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
 
          xassert (IT_CHARPOS (*it) >= BEGV);
        }