diff options
| author | Hendrik Tews | 2011-12-06 08:24:23 +0000 |
|---|---|---|
| committer | Hendrik Tews | 2011-12-06 08:24:23 +0000 |
| commit | 2797da42179670435c46b8cbaf5cccb5f8b76c51 (patch) | |
| tree | d3aac80876e6e663eac38ccccc9eeb317bcf756b | |
| parent | 4803894e4b9961e95a3298737466e4911794ffd4 (diff) | |
ensure optim-resp-window does not change the current buffer
| -rw-r--r-- | coq/coq.el | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -2499,22 +2499,20 @@ Only when three-buffer-mode is enabled." (when (and proof-three-window-enable (> (frame-height) 10) (get-buffer-window proof-response-buffer)) - (let ((curwin (selected-window)) - ;; maxhgth is the max height of both resp and goals buffers to avoid + (let (;; maxhgth is the max height of both resp and goals buffers to avoid ;; make the other disappear (maxhgth (- (window-height) window-min-height)) hgt-resp nline-resp) - (select-window (get-buffer-window proof-response-buffer)) - (setq hgt-resp (window-height)) - (setq nline-resp ; number of lines we want for response buffer - (min maxhgth (max window-min-height ; + 1 here for comfort - (+ 1 (count-lines (point-max) (point-min)))))) - (unless (is-not-split-vertic (selected-window)) - (shrink-window (- hgt-resp nline-resp))) - (goto-char (point-min)) - (recenter) - (select-window curwin) - ))) + (with-selected-window (get-buffer-window proof-response-buffer) + (setq hgt-resp (window-height)) + (setq nline-resp ; number of lines we want for response buffer + (min maxhgth (max window-min-height ; + 1 here for comfort + (+ 1 (count-lines (point-max) (point-min)))))) + (unless (is-not-split-vertic (selected-window)) + (shrink-window (- hgt-resp nline-resp))) + (goto-char (point-min)) + (recenter) + )))) ;; TODO: I would rather have a response-insert-hook thant this two hooks ;; Careful: optim-resp-windows must be called AFTER proof-show-first-goal |
