# HG changeset patch # User Gerd Moellmann # Date 941456360 0 # Node ID bcd25953e4cfc47b8fc02196afed41fca9441e30 # Parent cae8531d25650b90cd22147e1e175a7abc33d20f (end-of-buffer): Use window-end to find the window end instead of vertical-motion because this handles variable-height lines correctly. diff -r cae8531d2565 -r bcd25953e4cf lisp/simple.el --- a/lisp/simple.el Mon Nov 01 11:07:32 1999 +0000 +++ b/lisp/simple.el Mon Nov 01 11:39:20 1999 +0000 @@ -379,17 +379,12 @@ (point-max)))) ;; If we went to a place in the middle of the buffer, ;; adjust it to the beginning of a line. - (if arg (forward-line 1) - ;; If the end of the buffer is not already on the screen, - ;; then scroll specially to put it near, but not at, the bottom. - (if (let ((old-point (point))) - (save-excursion - (goto-char (window-start)) - (vertical-motion (window-height)) - (< (point) old-point))) - (progn - (overlay-recenter (point)) - (recenter -3))))) + (cond (arg (forward-line 1)) + ((< (point) (window-end nil t)) + ;; If the end of the buffer is not already on the screen, + ;; then scroll specially to put it near, but not at, the bottom. + (overlay-recenter (point)) + (recenter -3)))) (defun mark-whole-buffer () "Put point at beginning and mark at end of buffer.