From: Karl Heuer Date: Wed, 17 Mar 1999 04:49:21 +0000 (+0000) Subject: (shrink-window-if-larger-than-buffer): X-Git-Tag: emacs-20.4~457 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2de3834bb50c4609d24aeb6e91195ba29c553c9e;p=emacs.git (shrink-window-if-larger-than-buffer): Don't try to redisplay with the cursor at the end on its own line--that would force a scroll and spoil things. --- diff --git a/lisp/window.el b/lisp/window.el index cd043e0d47e..6010f894791 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -278,6 +278,10 @@ or if the window is the only window of its frame." (> (nth 1 edges) (cdr (assq 'menu-bar-lines params))))) (let ((text-height (window-buffer-height window)) (window-height (window-height))) + ;; Don't try to redisplay with the cursor at the end + ;; on its own line--that would force a scroll and spoil things. + (when (and (eobp) (bolp)) + (forward-char -1)) (when (> window-height (1+ text-height)) (shrink-window (- window-height (max (1+ text-height) window-min-height)))))))))