comparison lisp/simple.el @ 26265:bcd25953e4cf

(end-of-buffer): Use window-end to find the window end instead of vertical-motion because this handles variable-height lines correctly.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 01 Nov 1999 11:39:20 +0000
parents 097072728e80
children e3e54e862d5f
comparison
equal deleted inserted replaced
26264:cae8531d2565 26265:bcd25953e4cf
377 (/ size 10)) 377 (/ size 10))
378 (/ (* size (prefix-numeric-value arg)) 10))) 378 (/ (* size (prefix-numeric-value arg)) 10)))
379 (point-max)))) 379 (point-max))))
380 ;; If we went to a place in the middle of the buffer, 380 ;; If we went to a place in the middle of the buffer,
381 ;; adjust it to the beginning of a line. 381 ;; adjust it to the beginning of a line.
382 (if arg (forward-line 1) 382 (cond (arg (forward-line 1))
383 ;; If the end of the buffer is not already on the screen, 383 ((< (point) (window-end nil t))
384 ;; then scroll specially to put it near, but not at, the bottom. 384 ;; If the end of the buffer is not already on the screen,
385 (if (let ((old-point (point))) 385 ;; then scroll specially to put it near, but not at, the bottom.
386 (save-excursion 386 (overlay-recenter (point))
387 (goto-char (window-start)) 387 (recenter -3))))
388 (vertical-motion (window-height))
389 (< (point) old-point)))
390 (progn
391 (overlay-recenter (point))
392 (recenter -3)))))
393 388
394 (defun mark-whole-buffer () 389 (defun mark-whole-buffer ()
395 "Put point at beginning and mark at end of buffer. 390 "Put point at beginning and mark at end of buffer.
396 You probably should not use this function in Lisp programs; 391 You probably should not use this function in Lisp programs;
397 it is usually a mistake for a Lisp function to use any subroutine 392 it is usually a mistake for a Lisp function to use any subroutine