summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-02-19 16:44:07 +0000
committerGerd Moellmann <gerd@gnu.org>2001-02-19 16:44:07 +0000
commitc8bc6f6559904edd17dc1069d0418e5804cd4d15 (patch)
treeb5f8789a847fa62a0118f0550d532b92bb7ee15e /src
parent8b6ea97f85693986b8222789d320d21754186f3e (diff)
downloademacs-c8bc6f6559904edd17dc1069d0418e5804cd4d15.tar.gz
(Fmove_to_window_line): Undo last change.
(displayed_window_lines): Call line_bottom_y to determine the line's bottom position.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/window.c25
2 files changed, 17 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 80aedce45f2..4e9cd28e026 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
2001-02-19 Gerd Moellmann <gerd@gnu.org>
+ * window.c (Fmove_to_window_line): Undo last change.
+ (displayed_window_lines): Call line_bottom_y to determine
+ the line's bottom position.
+
+ * dispextern.h (line_bottom_y): Add prototype.
+
+ * xdisp.c (line_bottom_y): New function extracted from
+ pos_visible_p.
+ (pos_visible_p): Use it.
+
* keyboard.c (recursive_edit_1): Bind `inhibit-redisplay' and
set redisplaying_p to 0 here instead of in Frecursive_edit.
(Frecursive_edit): Don't bind `inhibit-redisplay' and don't
diff --git a/src/window.c b/src/window.c
index a84cd668c81..61c4d3c83b8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4495,25 +4495,18 @@ displayed_window_lines (w)
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 @@ zero means top of window, negative means relative to bottom of window.")
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);
}