aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar Hendrik Tews <hendrik@askra.de>2016-11-02 09:26:21 +0100
committerGravatar Hendrik Tews <hendrik@askra.de>2016-11-02 09:26:21 +0100
commit46680b32764da142337b6676ee7afa6eec14c9bc (patch)
tree884727ec88032834679507fb80d5ab380af01301 /generic
parent611e9f557a37364a3de4b89afa336a673dca7cfd (diff)
fix error in process filter: Cannot resize window
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-utils.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el
index d2cf760c..be5fee6e 100644
--- a/generic/proof-utils.el
+++ b/generic/proof-utils.el
@@ -431,14 +431,23 @@ or if the window is the only window of its frame."
;; buffers? Probably not an issue for us, but one
;; wonders at the shrink to fit strategy.
;; NB: way to calculate pixel fraction?
- (+ extraline (count-lines (point-min) (point-max)))))
+ (+ extraline (count-lines (point-min) (point-max))))
+ (safe-desired-height
+ ;; Under certain circumstances (involving a non-nil
+ ;; line-spacing), a desired-height of 1 (which happens
+ ;; quite often, eg for an empty response buffer) gives an
+ ;; error inside set-window-text-height. The reason for
+ ;; this is quite complicated, it involves rounding issues
+ ;; and emacs' habbit to sometimes resize a window by 2
+ ;; pixels.
+ (max 2 desired-height)))
;; Let's shrink or expand. Uses new GNU Emacs function.
(let ((window-size-fixed nil))
(set-window-text-height window
;; As explained earlier: use abs-max-height
;; but only if that makes it display all.
- (if (> desired-height absolute-max-height)
- max-height desired-height)))
+ (if (> safe-desired-height absolute-max-height)
+ max-height safe-desired-height)))
(if (window-live-p window)
(progn
(if (>= (window-text-height window) desired-height)