From e1b778f5f5963ca02177875dea09f4a12d95741b Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 8 Nov 2025 22:21:04 +0000 Subject: afio: per workspace frame parameters --- lib/eos/jao-afio.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'lib/eos/jao-afio.el') diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index 99152b0..04d31ba 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -23,6 +23,7 @@ (require 'jao-doc-session) (defvar jao-afio-use-frames (not window-system)) +(defvar jao-afio-frame-parameters nil) (defvar jao-open-doc-fun 'find-file) (defvar jao-afio-mail-function 'gnus) @@ -37,11 +38,18 @@ (when c (modify-frame-parameters f `((afio . ,c)))) (frame-parameter f 'afio)) +(defun jao-afio--set-up-frame (cfg) + (when jao-afio-use-frames + (let ((fn (jao-afio-frame-name cfg))) + (set-frame-name fn) + (when-let* ((params (cadr (assoc fn jao-afio-frame-parameters)))) + (modify-frame-parameters nil params))))) + (defun jao-afio--init (&optional f) (interactive) (jao-afio--current-config ?c) (if jao-afio-use-frames - (set-frame-name (jao-afio-frame-name ?c)) + (jao-afio--set-up-frame) (window-configuration-to-register ?c))) (defun jao-afio--check-frame () @@ -80,7 +88,7 @@ (defun jao-afio-open-doc () (interactive) (delete-other-windows) - (split-window-right) + (split-window-right 80) (let ((docs (cl-remove-if-not 'jao-doc-session-is-doc (buffer-list)))) (if (car docs) (progn (switch-to-buffer (car docs)) @@ -146,10 +154,12 @@ (defun jao-afio--open-mail (fun) (unless (get-buffer "*Calendar*") (calendar)) (delete-other-windows) - (split-window-horizontally -80) - (funcall fun) - ;; (set-window-dedicated-p nil t) - (jao-afio--mail-sidebar)) + (if (< (frame-width) 160) + (funcall fun) + (split-window-horizontally -80) + (funcall fun) + ;; (set-window-dedicated-p nil t) + (jao-afio--mail-sidebar))) ;;;###autoload (defun jao-afio-open-mail () @@ -194,8 +204,7 @@ (let ((f (jao-afio--find-frame next))) (select-frame-set-input-focus (or f (make-frame))) (when (setq reset (or reset (not f))) - (set-frame-name - (format "%s" (or (jao-afio-frame-name next) next))))) + (jao-afio--set-up-frame next))) (window-configuration-to-register (jao-afio--current-config)) (when (and (not reset) (get-register next)) (ignore-errors (jump-to-register next))) -- cgit v1.2.3