]> code.delx.au - gnu-emacs/commitdiff
(Frecenter): Simplify computation in the case of window
authorGerd Moellmann <gerd@gnu.org>
Wed, 12 Dec 2001 13:43:37 +0000 (13:43 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 12 Dec 2001 13:43:37 +0000 (13:43 +0000)
system frames and ARG < 0; use window_box_height.

src/ChangeLog
src/window.c

index 2dceefd631edf6c61c408abd9783ee84ac2f0b16..fc6c8577046196bfe3f66f61a59531f11cc947dc 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-12  Gerd Moellmann  <gerd@gnu.org>
+
+       * xdisp.c (move_it_vertically_backward): Change heuristic
+       for the case that we didn't move far enough initially.
+
+       * window.c (Frecenter): Simplify computation in the case of window
+       system frames and ARG < 0; use window_box_height.
+
 2001-12-11  Richard M. Stallman  <rms@gnu.org>
 
        * Makefile.in, mem-limits.h, dispnew.c, emacs.c, fileio.c:
index 7d0a1eec6cda3fb66631b9eb3b7136abf2448def..6ee3086d616cba7b1d3cf93f5c464c5febfa3782 100644 (file)
@@ -4584,18 +4584,17 @@ and redisplay normally--don't erase and redraw the frame.  */)
          nlines = - XINT (arg) - 1;
          move_it_by_lines (&it, nlines, 1);
 
-         y1 = it.current_y - y0;
-         h = line_bottom_y (&it) - y1;
+         y1 = line_bottom_y (&it);
 
          /* If we can't move down NLINES lines because we hit
             the end of the buffer, count in some empty lines.  */
          if (it.vpos < nlines)
            y1 += (nlines - it.vpos) * CANON_Y_UNIT (it.f);
          
-         y0 = it.last_visible_y - y1 - h;
-         
+         h = window_box_height (w) - (y1 - y0);
+
          start_display (&it, w, pt);
-         move_it_vertically (&it, - y0);
+         move_it_vertically (&it, - h);
          charpos = IT_CHARPOS (it);
          bytepos = IT_BYTEPOS (it);
        }