summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-03 02:13:08 +0100
committerjao <jao@gnu.org>2022-09-03 02:13:08 +0100
commitfa4ca035914c21d3cbacd3c82d4ead5ce814901c (patch)
treed73f3eba0463c8f1641117eb37a68f483b5c6fd5
parent67a5c79a89db0d41bba4453943489f62b7b27022 (diff)
downloadelibs-fa4ca035914c21d3cbacd3c82d4ead5ce814901c.tar.gz
elibs-fa4ca035914c21d3cbacd3c82d4ead5ce814901c.tar.bz2
a bit more sensible jao-trisect, after all these years
-rw-r--r--init.el11
1 files changed, 7 insertions, 4 deletions
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))))))