diff options
author | Paul Steckler <steck@stecksoft.com> | 2017-03-06 12:11:48 -0500 |
---|---|---|
committer | Paul Steckler <steck@stecksoft.com> | 2017-03-06 12:11:48 -0500 |
commit | e7c02888378d989e21caee07c0c4818168e34c16 (patch) | |
tree | 90f05b2f3642418c9ac850201aab65c1000e6e58 /coq | |
parent | 35f006ae2d7ca192742d2f22d7ee0d4926adbeb2 (diff) |
remove redundant calls, simplify code
Diffstat (limited to 'coq')
-rw-r--r-- | coq/coq.el | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -2673,27 +2673,27 @@ Only when three-buffer-mode is enabled." ;; https://github.com/cpitclaudel/company-coq/issues/8. (unless (memq 'no-response-display proof-shell-delayed-output-flags) ;; If there is no frame with goql+response then do nothing - (when (and proof-three-window-enable (coq-find-threeb-frames)) - (let ((pg-frame (car (coq-find-threeb-frames)))) ; selecting one adequat frame - (with-selected-frame pg-frame - (when (and (> (frame-height) 10) - (get-buffer-window proof-response-buffer)) - (let ((maxhgth - (- (+ (with-selected-window (get-buffer-window proof-goals-buffer t) (window-text-height)) - (with-selected-window (get-buffer-window proof-response-buffer t) (window-text-height))) - window-min-height)) - hgt-resp nline-resp) - (with-selected-window (get-buffer-window proof-response-buffer) - (setq hgt-resp (window-text-height)) - (with-current-buffer proof-response-buffer - (setq nline-resp ; number of lines we want for response buffer - (min maxhgth (max window-min-height ; + 1 for comfort - (+ 1 (count-lines (point-max) (point-min))))))) - (unless (is-not-split-vertic (selected-window)) - (shrink-window (- hgt-resp nline-resp))) - (with-current-buffer proof-response-buffer - (goto-char (point-min)) - (recenter)))))))))) + (let ((threeb-frames (coq-find-threeb-frames))) + (when (and proof-three-window-enable threeb-frames) + (let ((pg-frame (car threeb-frames))) ; selecting one adequate frame + (with-selected-frame pg-frame + (let ((response-window (get-buffer-window proof-response-buffer t)) + (goals-window (get-buffer-window proof-goals-buffer t))) + (when (and response-window + (> (frame-height) 10)) + (with-selected-window (get-buffer-window proof-response-buffer) + (with-current-buffer proof-response-buffer + (let* ((response-height (window-text-height response-window)) + (goals-height (window-text-height goals-window)) + (maxhgth (- (+ response-height goals-height) + window-min-height)) + (nline-resp ; number of lines we want for response buffer + (min maxhgth (max window-min-height ; + 1 for comfort + (+ 1 (count-lines (point-max) (point-min))))))) + (unless (is-not-split-vertic (selected-window)) + (shrink-window (- response-height nline-resp))) + (goto-char (point-min)) + (recenter)))))))))))) ;; TODO: remove/add hook instead? (defun coq-optimise-resp-windows-if-option () |