From 46680b32764da142337b6676ee7afa6eec14c9bc Mon Sep 17 00:00:00 2001 From: Hendrik Tews Date: Wed, 2 Nov 2016 09:26:21 +0100 Subject: fix error in process filter: Cannot resize window --- generic/proof-utils.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'generic') 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) -- cgit v1.2.3