diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/pg-response.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/generic/pg-response.el b/generic/pg-response.el index e278cec3..e903858e 100644 --- a/generic/pg-response.el +++ b/generic/pg-response.el @@ -130,6 +130,18 @@ Internal variable, setting this will have no effect!") (defun proof-three-window-enable () (proof-layout-windows)) + +(defun proof-guess-3win-display-policy (&optional policy) + "Return the 3 windows mode layout policy from user choice POLICY. +If POLIY is smart then guess the good policy from the current +frame geometry, otherwise follow POLICY." + (if (eq policy 'smart) + (cond + ((>= (frame-width) (* 1.5 split-width-threshold)) 'horizontal) + ((>= (frame-width) split-width-threshold) 'hybrid) + (t 'vertical)) + policy)) + (defun proof-select-three-b (b1 b2 b3 &optional policy) "Put the given three buffers into three windows. Following POLICY, which can be one of 'smart, 'horizontal, @@ -137,15 +149,7 @@ Following POLICY, which can be one of 'smart, 'horizontal, (interactive "bBuffer1:\nbBuffer2:\nbBuffer3:") (delete-other-windows) (switch-to-buffer b1) - (let ((pol)) - (if (eq policy 'smart) - (cond - ((>= (frame-width) (* 1.5 split-width-threshold)) - (setq pol 'horizontal)) - ((>= (frame-width) split-width-threshold) - (setq pol 'hybrid)) - (t (setq pol 'vertical))) - (setq pol policy)) + (let ((pol (proof-guess-3win-display-policy policy))) (save-selected-window (cond ((eq pol 'hybrid) |