aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aspinall2003-02-24 14:36:10 +0000
committerDavid Aspinall2003-02-24 14:36:10 +0000
commit7e9351d9adf94dc10cbece887c602e4944311856 (patch)
treec1c0223e0dfec010960c8f3350d8a60bbe5213c4
parent0230e6aeca0feab2b0d7ba0ce0bb56526521821d (diff)
Fix to shrink-windows-tofit
-rw-r--r--generic/proof-utils.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el
index 639f206d..ed7c1665 100644
--- a/generic/proof-utils.el
+++ b/generic/proof-utils.el
@@ -579,6 +579,9 @@ No action if BUF is nil or killed."
;; This is based on `shrink-window-if-larger-than-buffer' from window.el
;; Except that we also allow the window height to *expand*
;; FIXME: this works in a fairly ugly way!
+;; Also desirable improvements would be to add some crafty history based
+;; on user resize-events. E.g. user resizes window, that becomes the
+;; new maximum size.
(defun proof-resize-window-tofit (&optional window)
"Shrink the WINDOW to be as small as possible to display its contents.
Do not shrink to less than `window-min-height' lines.
@@ -622,9 +625,9 @@ or if the window is the only window of its frame."
(goto-char (point-min))
(while (and (window-live-p window)
(if expand
- (not (pos-visible-in-window-p test-pos window))
- (pos-visible-in-window-p test-pos window))
- (< n max-height))
+ (and (not (pos-visible-in-window-p test-pos window))
+ (< (window-height window) max-height))
+ (pos-visible-in-window-p test-pos window)))
(shrink-window (if expand -1 1) nil window)
(setq n (1+ n))))
(if (and (not expand)