From: Gerd Moellmann Date: Fri, 8 Mar 2002 12:32:02 +0000 (+0000) Subject: (move_it_vertically_backward): At the end of the X-Git-Tag: emacs-21.2~30 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e0d9e23de94891d7946c57ad6a3a06cb4dd3bd62;p=emacs.git (move_it_vertically_backward): At the end of the function, when moving forward by lines, treat terminal frames specially. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6059351bb37..8c5494fb09e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-03-08 Gerd Moellmann + + * 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 * coding.h (run_pre_post_conversion_on_str): Add prototype. diff --git a/src/xdisp.c b/src/xdisp.c index 9da2426a93c..eb4070078a5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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); }