comparison lisp/window.el @ 33537:53c51fd75027

(fit-window-to-buffer): Fix previous change.
author Kenichi Handa <handa@m17n.org>
date Thu, 16 Nov 2000 06:33:25 +0000
parents 035e7b097577
children 7c2b5397acbc
comparison
equal deleted inserted replaced
33536:035e7b097577 33537:53c51fd75027
498 (goto-char (point-max)) 498 (goto-char (point-max))
499 (if (and (bolp) (not (bobp))) 499 (if (and (bolp) (not (bobp)))
500 (1- (point)) 500 (1- (point))
501 (point)))))) 501 (point))))))
502 (set-window-vscroll window 0) 502 (set-window-vscroll window 0)
503 (prog1
504 (list desired-height max-height)
505 (while (and (< desired-height max-height) 503 (while (and (< desired-height max-height)
506 (= desired-height (window-height window)) 504 (= desired-height (window-height window))
507 (not (pos-visible-in-window-p end window t))) 505 (not (pos-visible-in-window-p end window t)))
508 (enlarge-window 1) 506 (enlarge-window 1)
509 (setq desired-height (1+ desired-height)))))))) 507 (setq desired-height (1+ desired-height)))))))
510 508
511 (defun shrink-window-if-larger-than-buffer (&optional window) 509 (defun shrink-window-if-larger-than-buffer (&optional window)
512 "Shrink the WINDOW to be as small as possible to display its contents. 510 "Shrink the WINDOW to be as small as possible to display its contents.
513 Do not shrink to less than `window-min-height' lines. 511 Do not shrink to less than `window-min-height' lines.
514 Do nothing if the buffer contains more lines than the present window height, 512 Do nothing if the buffer contains more lines than the present window height,