diff options
author | 2003-03-01 11:26:17 +0000 | |
---|---|---|
committer | 2003-03-01 11:26:17 +0000 | |
commit | ae11020a030b6d16c244cd753ce84b6f68338325 (patch) | |
tree | cf7b7f958bdbf6ad27d6452176fe242652ebb8db /generic | |
parent | fbbaa50259de55930445f3a5c188b10179055b16 (diff) |
Some fixes/error protection in shrink window
Diffstat (limited to 'generic')
-rw-r--r-- | generic/proof-utils.el | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el index ed7c1665..cfbb2f9b 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -625,22 +625,26 @@ or if the window is the only window of its frame." (goto-char (point-min)) (while (and (window-live-p window) (if expand - (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) + (not (pos-visible-in-window-p test-pos window)) + (pos-visible-in-window-p test-pos window)) + (< n max-height)) + (ignore-errors + ;; FIXME: this often gives "won't change only window" error + (shrink-window (if expand -1 1) nil window)) (setq n (1+ n)))) (if (and (not expand) ;; attempt to get some stability: only shrink if ;; we're more than two lines too big. (> n 2)) - (shrink-window (min (1- n) - (- (window-height window) - (1+ window-min-height))) - nil - window) + (ignore-errors + (shrink-window (min (1- n) + (- (window-height window) + (1+ window-min-height))) + nil + window)) ;; Always expand the window if necessary. - (shrink-window (- n)))))))) + (ignore-errors + (shrink-window (- n))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; |