From 0b5e320d07f841d6eab9225cd1eac672ee70ecdc Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 10 Sep 2022 22:04:17 +0100 Subject: jao-afio: jao-trisect belongs there --- init.el | 17 +---------------- lib/eos/jao-afio.el | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/init.el b/init.el index 6c295f0..d5883d1 100644 --- a/init.el +++ b/init.el @@ -1255,22 +1255,7 @@ (use-package tool-bar) (tool-bar-mode -1) -(defun jao-trisect (&optional force) - (interactive) - (let ((fw (frame-width))) - (cond ((or force (>= fw 240)) - (let ((b (current-buffer))) - (delete-other-windows) - (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)))))) +(defalias 'jao-trisect 'jao-afio-trisect) (defun jao-bisect () (interactive) diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index 6369697..be25d65 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -48,6 +48,24 @@ (unless (jao-afio--current-config) (jao-afio--init (window-frame (get-buffer-window (current-buffer)))))) +;;; utilities +(defun jao-afio-trisect (&optional force) + (interactive) + (let ((fw (frame-width))) + (cond ((or force (>= fw 240)) + (let ((b (current-buffer))) + (delete-other-windows) + (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)))))) + ;;; session openers ;;;###autoload (defun jao-afio-open-pdf-session (&optional docs) @@ -152,7 +170,7 @@ (?w (jao-afio-open-www)) (?g (jao-afio-open-mail)) (?p (jao-afio-open-doc)) - (?s (delete-other-windows)))) + (?s (jao-afio-trisect)))) ;;; go to frame (defsubst jao-afio--find-frame (c) -- cgit v1.2.3