# HG changeset patch # User Gerd Moellmann # Date 982601020 0 # Node ID 8d5b7f7422868952ed4fb0e76c0d7b6fbf3ab1a7 # Parent 32505f3d0441f7dda99a3fb5875fe74cc9115838 (Fmove_to_window_line): Undo last change. (displayed_window_lines): Call line_bottom_y to determine the line's bottom position. diff -r 32505f3d0441 -r 8d5b7f742286 src/window.c --- a/src/window.c Mon Feb 19 16:43:09 2001 +0000 +++ b/src/window.c Mon Feb 19 16:43:40 2001 +0000 @@ -4495,25 +4495,18 @@ SET_TEXT_POS_FROM_MARKER (start, w->start); start_display (&it, w, start); move_it_vertically (&it, height); - - if (old_buffer) - set_buffer_internal (old_buffer); - - bottom_y = it.current_y + it.max_ascent + it.max_descent; - - if (bottom_y > it.current_y && bottom_y <= it.last_visible_y) - /* Hit a line without a terminating newline. */ - it.vpos++; + bottom_y = line_bottom_y (&it); /* Add in empty lines at the bottom of the window. */ if (bottom_y < height) { - struct frame *f = XFRAME (w->frame); - int rest = height - bottom_y; - int lines = rest / CANON_Y_UNIT (f); - it.vpos += lines; + int uy = CANON_Y_UNIT (it.f); + it.vpos += (height - bottom_y + uy - 1) / uy; } + if (old_buffer) + set_buffer_internal (old_buffer); + return it.vpos; } @@ -4659,13 +4652,9 @@ XSETINT (arg, XINT (arg) + lines); } -#if 0 /* I don't understand why this is done. Among other things, - it means that C-u 0 M-r moves to line 1, and C-u -1 M-r - moves to the line below the window end. 2000-02-05, gerd */ + /* Skip past a partially visible first line. */ if (w->vscroll) - /* Skip past a partially visible first line. */ XSETINT (arg, XINT (arg) + 1); -#endif return Fvertical_motion (arg, window); }