# HG changeset patch # User Richard M. Stallman # Date 778290975 0 # Node ID 415a25bb4ee76d5f33021e5b68b6edcf2b371d02 # Parent 34db69f96583f9989b26873cf911d4c37d72be2c (shrink-window-if-larger-than-buffer): Don't make the window shorter than window-min-height. diff -r 34db69f96583 -r 415a25bb4ee7 lisp/window.el --- a/lisp/window.el Tue Aug 30 22:45:10 1994 +0000 +++ b/lisp/window.el Tue Aug 30 23:56:15 1994 +0000 @@ -145,6 +145,7 @@ (defun shrink-window-if-larger-than-buffer (&optional window) "Shrink the WINDOW to be as small as possible to display its contents. +Do not shrink to less that `window-min-height' lines. Do nothing if the buffer contains more lines than the present window height, or if some of the window's contents are scrolled out of view, or if the window is not the full width of the frame, @@ -161,7 +162,6 @@ ;; unless point is after it. (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))) - (window-min-height 0) (buffer-read-only nil) (modified (buffer-modified-p)) (buffer (current-buffer)) @@ -185,7 +185,10 @@ ;; defeat file locking... don't try this at home, kids! (setq buffer-file-name nil) (insert ?\n) (setq n (1+ n))) - (if (> n 0) (shrink-window (1- n)))) + (if (> n 0) + (shrink-window (min (1- n) + (- (window-height) + window-min-height))))) (delete-region (point-min) (point)) (set-buffer-modified-p modified) (goto-char p)