From fa4ca035914c21d3cbacd3c82d4ead5ce814901c Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 3 Sep 2022 02:13:08 +0100 Subject: a bit more sensible jao-trisect, after all these years --- init.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 393ad27..215fed5 100644 --- a/init.el +++ b/init.el @@ -1347,14 +1347,17 @@ (defun jao-trisect (&optional force) (interactive) (let ((fw (frame-width))) - (delete-other-windows) (cond ((or force (>= fw 240)) - (let ((w (- (/ fw 3)))) + (let ((b (current-buffer))) (delete-other-windows) - (split-window-horizontally w) - (split-window-horizontally w) + (switch-to-buffer (other-buffer b)) + (split-window-horizontally) + (switch-to-buffer (other-buffer b)) + (split-window-horizontally) + (switch-to-buffer b) (balance-windows))) ((> fw 162) + (delete-other-windows) (split-window-horizontally) (switch-to-buffer (other-buffer)))))) -- cgit v1.2.3